Skip to content

Commit aea23c3

Browse files
dsaherndavem330
authored andcommitted
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: c7a1ce3 ("ipv6: Change addrconf_f6i_alloc to use ip6_route_info_create") Reported-by: [email protected] Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f815dd5 commit aea23c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3405,7 +3405,7 @@ static bool fib6_is_reject(u32 flags, struct net_device *dev, int addr_type)
34053405
if ((flags & RTF_REJECT) ||
34063406
(dev && (dev->flags & IFF_LOOPBACK) &&
34073407
!(addr_type & IPV6_ADDR_LOOPBACK) &&
3408-
!(flags & RTF_LOCAL)))
3408+
!(flags & (RTF_ANYCAST | RTF_LOCAL))))
34093409
return true;
34103410

34113411
return false;

0 commit comments

Comments
 (0)