]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: Fix use of anycast address with loopback
authorDavid Ahern <dsahern@kernel.org>
Tue, 7 Jul 2020 13:39:24 +0000 (07:39 -0600)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jul 2020 20:04:16 +0000 (13:04 -0700)
commit2168d57ae22ae178f8bcef80b044e53eca0e0adb
tree7e63e44e32b6bea19471ae17cc75cc30361dadd2
parent42ae599e12fd6829a0992cd74c38b1b859b15797
ipv6: Fix use of anycast address with loopback

Thomas reported a regression with IPv6 and anycast using the following
reproducer:

    echo 1 >  /proc/sys/net/ipv6/conf/all/forwarding
    ip -6 a add fc12::1/16 dev lo
    sleep 2
    echo "pinging lo"
    ping6 -c 2 fc12::

The conversion of addrconf_f6i_alloc to use ip6_route_info_create missed
the use of fib6_is_reject which checks addresses added to the loopback
interface and sets the REJECT flag as needed. Update fib6_is_reject for
loopback checks to handle RTF_ANYCAST addresses.

Fixes: 157c4223e771 ("ipv6: Change addrconf_f6i_alloc to use ip6_route_info_create")
Reported-by: thomas.gambier@nexedi.com
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c