Skip to content

Commit 4e914ef

Browse files
Guillaume Naultkuba-moo
authored andcommitted
gre: Fix IPv6 multicast route creation.
Use addrconf_add_dev() instead of ipv6_find_idev() in addrconf_gre_config() so that we don't just get the inet6_dev, but also install the default ff00::/8 multicast route. Before commit 3e6a024 ("gre: Fix again IPv6 link-local address generation."), the multicast route was created at the end of the function by addrconf_add_mroute(). But this code path is now only taken in one particular case (gre devices not bound to a local IP address and in EUI64 mode). For all other cases, the function exits early and addrconf_add_mroute() is not called anymore. Using addrconf_add_dev() instead of ipv6_find_idev() in addrconf_gre_config(), fixes the problem as it will create the default multicast route for all gre devices. This also brings addrconf_gre_config() a bit closer to the normal netdevice IPv6 configuration code (addrconf_dev_config()). Cc: [email protected] Fixes: 3e6a024 ("gre: Fix again IPv6 link-local address generation.") Reported-by: Aiden Yang <[email protected]> Closes: https://lore.kernel.org/netdev/CANR=AhRM7YHHXVxJ4DmrTNMeuEOY87K2mLmo9KMed1JMr20p6g@mail.gmail.com/ Reviewed-by: Gary Guo <[email protected]> Tested-by: Gary Guo <[email protected]> Signed-off-by: Guillaume Nault <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Link: https://patch.msgid.link/027a923dcb550ad115e6d93ee8bb7d310378bd01.1752070620.git.gnault@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2dfa4e3 commit 4e914ef

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

net/ipv6/addrconf.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,11 +3525,9 @@ static void addrconf_gre_config(struct net_device *dev)
35253525

35263526
ASSERT_RTNL();
35273527

3528-
idev = ipv6_find_idev(dev);
3529-
if (IS_ERR(idev)) {
3530-
pr_debug("%s: add_dev failed\n", __func__);
3528+
idev = addrconf_add_dev(dev);
3529+
if (IS_ERR(idev))
35313530
return;
3532-
}
35333531

35343532
/* Generate the IPv6 link-local address using addrconf_addr_gen(),
35353533
* unless we have an IPv4 GRE device not bound to an IP address and
@@ -3543,9 +3541,6 @@ static void addrconf_gre_config(struct net_device *dev)
35433541
}
35443542

35453543
add_v4_addrs(idev);
3546-
3547-
if (dev->flags & IFF_POINTOPOINT)
3548-
addrconf_add_mroute(dev);
35493544
}
35503545
#endif
35513546

0 commit comments

Comments
 (0)