On Mon, 12 Mar 2018 19:48:33 +0000 Luca Boccassi <bl...@debian.org> wrote:
> On Mon, 2018-03-05 at 08:51 -0800, Stephen Hemminger wrote: > > On Sun, 04 Mar 2018 22:07:37 +0000 > > Luca Boccassi <bl...@debian.org> wrote: > > > > > On Mon, 26 Feb 2018 12:05:05 +0100 Wolfgang Walter <wolfgang.walter > > > @stw > > > m.de> wrote: > > > > Package: iproute2 > > > > Version: 4.15.0-2 > > > > > > > > Hello, > > > > > > > > after upgrading iproute2 from 4.14.1-2 to 4.15.0-2 > > > > > > > > ip route flush all > > > > > > > > seems not to work any more. It does not remove all ipv4 routes > > > > from > > > > > > the main > > > > table as it did before. Downgrading to 4.14.1-2 fixes the > > > > problem. > > > > > > > > Basically 4.15.0-2 removes the default route, but other routes > > > > are > > > > > > not > > > > removed. > > > > > > > > What still works is > > > > > > > > ip route flush table main > > > > > > > > > > > > Another thing which changed is that > > > > > > > > ip route ls all > > > > > > > > now does not show anything but the default route whereas it used > > > > to > > > > > > show all > > > > routes of the main table. > > > > > > Hi, > > > > > > Yes can confirm, it's easily reproduced. > > > > > > Stephen, do you know if is this a known change in behaviour? > > > > > > With 4.14.0: > > > > > > $ ip route ls all > > > default via 192.168.1.1 dev wlp2s0 proto static metric 600 > > > 169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown > > > 192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.5 > > > metric 600 > > > 192.168.122.0/24 dev virbr0 proto kernel scope link src > > > 192.168.122.1 linkdown > > > > > > With 4.15.0: > > > > > > $ ip route ls all > > > default via 192.168.1.1 dev wlp2s0 proto static metric 600 > > > > > > Further tests with 4.15.0: > > > > > > $ ip route ls table main > > > default via 192.168.1.1 dev wlp2s0 proto static metric 600 > > > 169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown > > > 192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.5 > > > metric 600 > > > 192.168.122.0/24 dev virbr0 proto kernel scope link src > > > 192.168.122.1 linkdown > > > $ sudo ip route flush all > > > $ ip route ls all > > > $ ip route ls table main > > > 169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown > > > 192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.5 > > > metric 600 > > > 192.168.122.0/24 dev virbr0 proto kernel scope link src > > > 192.168.122.1 linkdown > > > > > > $ sudo ip route add default via 192.168.1.1 > > > $ ip route ls table main > > > default via 192.168.1.1 dev wlp2s0 > > > 169.254.0.0/16 dev virbr0 scope link metric 1000 linkdown > > > 192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.5 > > > metric 600 > > > 192.168.122.0/24 dev virbr0 proto kernel scope link src > > > 192.168.122.1 linkdown > > > $ ip route ls all > > > default via 192.168.1.1 dev wlp2s0 > > > $ sudo ip route flush table main > > > $ ip route ls all > > > $ ip route ls table main > > > > Is it a kernel or iproute issue? Should be bisectable. > > Hi Stephen, > > It was caused by this commit: > > commit 9135c4d6037ff9f1818507bac0049fc44db8c3d2 > Author: Alexander Zubkov <gr...@msu.ru> > Date: Sun Dec 17 12:09:00 2017 +0100 > > iproute: "list/flush/save default" selected all of the routes > > When running "ip route list default" and not specifying address family, > one will get all of the routes instead of just default only. The same > is for "exact default" and "match default". > > It behaves in such a way because default route with unspecified family > has the same all-zeroes value like no prefix specified at all. Thus > following code blindly ignores the fact, that prefix was actually > specified. > > This patch adds the flag PREFIXLEN_SPECIFIED to the default route too. > And then checks its value when filtering routes. > > > > Looking at the message, it looks like it might have been intentional? > But it looks like a backward-incompatible change to me > My expectation is that: # ip route flush is for flushing all routes. And the patch in question was for # ip route flush default The issue is that default means 0/0 (or::/0) which is also a wildcard for flushing all. Right now I am going to revert the original patch since it was only because ip didn't do what one user expected; not the same as breaking everyone else.
pgprhkwai_wBZ.pgp
Description: OpenPGP digital signature