]> git.ipfire.org Git - thirdparty/iproute2.git/commit
iproute: "list/flush/save default" selected all of the routes
authorAlexander Zubkov <green@msu.ru>
Sun, 17 Dec 2017 11:09:00 +0000 (12:09 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 19 Dec 2017 16:23:09 +0000 (08:23 -0800)
commit9135c4d6037ff9f1818507bac0049fc44db8c3d2
treebea271ba261b4f8c34767e5498b780b7c93441ac
parented7fdc950d641376352061f2799dd2d0dd72accd
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.

Signed-off-by: Alexander Zubkov <green@msu.ru>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iproute.c
lib/utils.c