]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: enforce egress device match in per table nexthop lookups
authorPaolo Abeni <pabeni@redhat.com>
Thu, 23 Jun 2016 13:25:09 +0000 (15:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jun 2016 14:37:20 +0000 (10:37 -0400)
commit6ba46cb97fb662529193d2746e4c3d3797252365
tree1707081a7e522c1f4ae9a8b30997e4f72532ef0c
parentb711ee8c6013996e9005ac9ccc637c8c9d7a16df
ipv6: enforce egress device match in per table nexthop lookups

with the commit 9d6e8d441cbd ("net: ipv6: Use passed in table for
nexthop lookups"), net hop lookup is first performed on route creation
in the passed-in table.
However device match is not enforced in table lookup, so the found
route can be later discarded due to egress device mismatch and no
global lookup will be performed.
This cause the following to fail:

ip link add dummy1 type dummy
ip link add dummy2 type dummy
ip link set dummy1 up
ip link set dummy2 up
ip route add 2001:db8:8086::/48 dev dummy1 metric 20
ip route add 2001:db8:d34d::/64 via 2001:db8:8086::2 dev dummy1 metric 20
ip route add 2001:db8:8086::/48 dev dummy2 metric 21
ip route add 2001:db8:d34d::/64 via 2001:db8:8086::2 dev dummy2 metric 21
RTNETLINK answers: No route to host

This change fixes the issue enforcing device lookup in
ip6_nh_lookup_table()

v1->v2: updated commit message title

Fixes: 9d6e8d441cbd ("net: ipv6: Use passed in table for nexthop lookups")
Reported-and-tested-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c