From: Stephen Suryaputra <ssuryaextr@gmail.com>
To: netdev@vger.kernel.org
Cc: a@unstable.cc
Subject: Sysctl addr_gen_mode does not control tunnel link-local addr
Date: Tue, 19 Oct 2021 21:30:05 -0400 [thread overview]
Message-ID: <20211020013005.GA4864@ICIPI.localdomain> (raw)
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.
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c6a90b7bbb70..da7e83699eef 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -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.
next reply other threads:[~2021-10-20 1:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 1:30 Stephen Suryaputra [this message]
2021-10-20 12:59 ` Sysctl addr_gen_mode does not control tunnel link-local addr Antonio Quartulli
2021-10-20 13:50 ` Stephen Suryaputra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211020013005.GA4864@ICIPI.localdomain \
--to=ssuryaextr@gmail.com \
--cc=a@unstable.cc \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox