]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip-route: Fix for listing routes with RTAX_LOCK attribute
authorPhil Sutter <phil@nwl.cc>
Thu, 28 Sep 2017 17:33:56 +0000 (19:33 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 29 Sep 2017 19:02:09 +0000 (12:02 -0700)
commite4139268ba9608fff5915a9852c72f7ef69690a3
treed4eba593d283ceaa954d10988b5a514f5df463f8
parentb2fd7a0e6efa7b85a041b5cb9ea6fc1a6a798fd3
ip-route: Fix for listing routes with RTAX_LOCK attribute

This fixes a corner-case for routes with a certain metric locked to
zero:

| ip route add 192.168.7.0/24 dev eth0 window 0
| ip route add 192.168.7.0/24 dev eth0 window lock 0

Since the kernel doesn't dump the attribute if it is zero, both routes
added above would appear as if they were equal although they are not.

Fix this by taking mxlock value for the given metric into account before
skipping it if it is not present.

Reported-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
ip/iproute.c