ipv4: fix nexthop attlen check in fib_nh_match
commit66dff16a0d01823e04246478b86c8591b7aad447
authorJiri Pirko <jiri@resnulli.us>
Mon, 13 Oct 2014 14:34:10 +0000 (13 16:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 24 May 2015 08:10:53 +0000 (24 10:10 +0200)
tree2d81e5020fe3377dad696525f0f8e6bf0c6396ef
parent1d37a6b8fd918c2b308ac1a55da94aab34acbb83
ipv4: fix nexthop attlen check in fib_nh_match

commit f76936d07c4eeb36d8dbb64ebd30ab46ff85d9f7 upstream.

fib_nh_match does not match nexthops correctly. Example:

ip route add 172.16.10/24 nexthop via 192.168.122.12 dev eth0 \
                          nexthop via 192.168.122.13 dev eth0
ip route del 172.16.10/24 nexthop via 192.168.122.14 dev eth0 \
                          nexthop via 192.168.122.15 dev eth0

Del command is successful and route is removed. After this patch
applied, the route is correctly matched and result is:
RTNETLINK answers: No such process

Please consider this for stable trees as well.

Fixes: 4e902c57417c4 ("[IPv4]: FIB configuration using struct fib_config")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 0aba46add2915b344580569e87d9c41274b9c475)

Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/fib_semantics.c