]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: reject locally assigned nexthop addresses
authorFlorian Westphal <fw@strlen.de>
Wed, 20 May 2015 22:25:41 +0000 (00:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2015 03:23:38 +0000 (23:23 -0400)
commit1ecead6425290e25743754a619b2120324533a6b
tree0e814f2067f2c93abdcab8eb60412ed1fe03fb2a
parent4dc78fe8526c39c18872429da37576b18cd06378
ipv6: reject locally assigned nexthop addresses

ip -6 addr add dead::1/128 dev eth0
sleep 5
ip -6 route add default via dead::1/128
-> fails
ip -6 addr add dead::1/128 dev eth0
ip -6 route add default via dead::1/128
-> succeeds

reason is that if (nonsensensical) route above is added,
dead::1 is still subject to DAD, so the route lookup will
pick eth0 as outdev due to the prefix route that is added before
DAD work is started.

Add explicit test that checks if nexthop gateway is a local address.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1167969
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c