]> git.ipfire.org Git - thirdparty/iproute2.git/commit
route: filter by interface on multipath routes
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 5 Jul 2024 00:26:41 +0000 (17:26 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 5 Jul 2024 00:44:55 +0000 (17:44 -0700)
commit0ea0699ea01df81750becf742083933a23a95d94
tree5fcd6279d4daf1e49093b03c31e1d16ab0da21ba
parent357808abd3a67bcf4d1444a25268c45dda62e87f
route: filter by interface on multipath routes

The ip route command would silently hide multipath routes when filter
by interface. The problem was it was not looking for interface when
filter multipath routes.

Example:
ip link add name dummy1 up type dummy
ip link add name dummy2 up type dummy
ip address add 192.0.2.1/28 dev dummy1
ip address add 192.0.2.17/28 dev dummy2
ip route add 198.51.100.0/24 \
nexthop via 192.0.2.2 dev dummy1 \
nexthop via 192.0.2.18 dev dummy2

Before:
ip route show dev dummy1
192.0.2.0/28 proto kernel scope link src 192.0.2.1

After:
ip route show dev dummy1
192.0.2.0/28 proto kernel scope link src 192.0.2.1
198.51.100.0/24
nexthop via 192.0.2.2 dev dummy1 weight 1
nexthop via 192.0.2.18 dev dummy2 weight 1

Reported-by: "Muggeridge, Matt" <matt.muggeridge2@hpe.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iproute.c