]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commit4dab8239b146e399851bafc6c39df4a10c52667a
treeebfd69023d33508fd01754a1c839da0c707e09de
parent243c23348a928799ca46bd3b036f9e60513c4e01
ipv6: Fix use of anycast address with loopback

BugLink: https://bugs.launchpad.net/bugs/1888560
[ Upstream commit aea23c323d89836bcdcee67e49def997ffca043b ]

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: c7a1ce397ada ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/ipv6/route.c