Sysctl addr_gen_mode does not control tunnel link-local addr
Subsystems (3)
Hi,
I noticed that tunnels, especially sit before commit e5dd729460ca8 ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address"), generates link-local addr regardless of addr_gen_mode setting. Is this a bug, or is there a specific reason?
In my system, the link-local addr are generated by a userspace process. So, we set net.ipv6.conf.<dev>.addr_gen_mode to 1 (IN6_ADDR_GEN_MODE_NONE).
The commit e5dd729460ca8 doesn't change the behavior as it is renaming sit_add_v4_addrs() to add_v4_addrs() as make it generic for GRE/IP6GRE cases. I'm not sure what the current behavior is for GRE, i.e. whether addr_gen_mode can control the generation of link-local addr.
If this is a bug or oversight, I think this diff should fix it and I can put a formal patch.
net/ipv6/addrconf.c +0 -0
@@ -3392,6 +3392,8 @@ static void addrconf_sit_config(struct net_device
*dev)
return;
}+ if (idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_NONE)
+ return;
add_v4_addrs(idev);
if (dev->flags&IFF_POINTOPOINT)The commit mention about addressing violation of RFC4291 on GRE and the diff above doesn't cause it to change as the default addr_gen_mode is 0 (IN6_ADDR_GEN_MODE_EUI64).
Thanks,
Stephen.
Hi,
Quoted 10 lines · Stephen Suryaputra
Hi,
I noticed that tunnels, especially sit before commit
e5dd729460ca8("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address"), generates link-local addr regardless ofaddr_gen_modesetting. Is this a bug, or is there a specific reason?In my system, the link-local addr are generated by a userspace process. So, we set net.ipv6.conf.<dev>.addr_gen_mode to 1 (
IN6_ADDR_GEN_MODE_NONE).
Quoted 7 lines
The commit
e5dd729460ca8doesn't change the behavior as it is renamingsit_add_v4_addrs()toadd_v4_addrs()as make it generic for GRE/IP6GRE cases. I'm not sure what the current behavior is for GRE, i.e. whetheraddr_gen_modecan control the generation of link-local addr.If this is a bug or oversight, I think this diff should fix it and I can put a formal patch.
When I implemented this behavior for SIT interfaces I basically ported what is currently happening for GRE.
Therefore, any change you apply to SIT, should also be reflected in the GRE code path.
As of now, the SIT/GRE addrgen logic does not consider the mode setting at all. But I am not sure it'd be easy to support all the values.
For sure, supporting IN6_ADDR_GEN_MODE_NONE is a low hanging fruit and should be implemented.
net/ipv6/addrconf.c static void addrconf_sit_config(struct net_device · line 3397
Quoted 12 lines
net/ipv6/addrconf.c +2
-0@@ -3392,6 +3392,8 @@ static void addrconf_sit_config(struct net_device *dev)return ; } +if (idev->cnf.addr_gen_mode ==IN6_ADDR_GEN_MODE_NONE ) +return ;
Please add an empty line here.
Quoted 7 lines
net/ipv6/addrconf.c +0
-0add_v4_addrs (idev);if (dev->flags&IFF_POINTOPOINT)The commit mention about addressing violation of RFC4291 on GRE and the diff above doesn't cause it to change as the default
addr_gen_modeis 0 (IN6_ADDR_GEN_MODE_EUI64).
Other than my nitpick above, I'd suggest applying the same change to the GRE code path, as the behavior should be the same.
Moreover, do you think that addrconf_add_mroute() should not be executed in this case? Otherwise you could simply add your new code into add_v4_addrs().
Regards,
Signature · 1 line
Antonio Quartulli
Quoted 3 lines · Antonio Quartulli
For sure, supporting
IN6_ADDR_GEN_MODE_NONEis a low hanging fruit and should be implemented.
Thanks for reaffirming this!
Quoted 6 lines
Other than my nitpick above, I'd suggest applying the same change to the GRE code path, as the behavior should be the same.
Moreover, do you think that
addrconf_add_mroute()should not be executed in this case? Otherwise you could simply add your new code intoadd_v4_addrs().
Initially I was thinking that why there is a need to call addrconf_add_mroute() given the link-local addr hasn't been set. On a second look, yes, the conditional is better be in add_v4_addrs(). It will take care of GRE as well.
I'll put a formal patch.
Thanks!