From: Rocco Yue <rocco.yue@mediatek.com>
To: <lorenzo@google.com>, <dsahern@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
David Ahern <dsahern@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>, <Rocco.Yue@gmail.com>,
<chao.song@mediatek.com>, <yanjie.jiang@mediatek.com>,
<kuohong.wang@mediatek.com>, <zhuoliang.zhang@mediatek.com>,
<maze@google.com>, <markzzzsmith@gmail.com>,
Rocco Yue <rocco.yue@mediatek.com>
Subject: Re: [PATCH net-next] ipv6: don't generate link-local addr in random or privacy mode
Date: Wed, 17 Nov 2021 15:17:32 +0800 [thread overview]
Message-ID: <20211117071732.7455-1-rocco.yue@mediatek.com> (raw)
In-Reply-To: <CAKD1Yr02W-WuLx8ouvP+wTtkxeyTBW_dp1deo9sim7wfLA2LXQ@mail.gmail.com>
On Wed, 2021-11-17 at 13:09 +0800, Lorenzo Colitti wrote:
> On Tue, Nov 16, 2021 at 3:15 PM Rocco Yue <rocco.yue@mediatek.com>
> wrote:
>>
>> In the 3GPP TS 29.061, here is a description as follows:
>> "In order to avoid any conflict between the link-local address
>> of the MS and that of the GGSN, the Interface-Identifier used by
>> the MS to build its link-local address shall be assigned by the
>> GGSN.
>> [...]
>> 1) IN6_ADDR_GEN_MODE_STABLE_PRIVACY_NO_LLA, this mode is suitable
>> for cellular networks that support RFC7217. In this mode, the
>> kernel doesn't generate a link-local address for the cellular
>> NIC, and generates an ipv6 stable privacy global address after
>> receiving the RA message.
>
>
> It sounds like this would violate RFC 4291 section 2.1 which says
> "All
> interfaces are required to have at least one Link-Local unicast
> address. It is also not what 3GPP requires. 3GPP *does* require a
> link-local address. It just requires that that the bottom 64 bits of
> that link-local address be assigned by the network, not randomly.
>
Hi Lorenzo,
Thanks for your reply. :-)
Disabling the kernel's automatic link-local address generation
doesn't mean that it violates RFC 4291, because an appropriate
link-local addr can be added to the cellulal NIC through ioctl.
In fact, the current kernel has similar precedents. For example,
when device type is ARPHRD_NONE, and its addr_gen_mode is NONE,
the kernel will never generate a link-local addr for such interface.
> Given that the kernel already supports tokenized interface addresses,
> a better option here would be to add new addrgen modes where the
> link-local address is formed from the interface token (idev->token),
> and the other addresses are formed randomly or via RFC7217. These
> modes could be called IN6_ADDR_GEN_MODE_RANDOM_LL_TOKEN and
> IN6_ADDR_GEN_MODE_STABLE_PRIVACY_LL_TOKEN. When setting up the
> interface, userspace could set disable_ipv6 to 1, then set the
> interface token and the address generation mode via RTM_SETLINK, then
> set disable_ipv6 to 0 to start autoconf. The kernel would then form
> the link-local address via the token (which comes from the network),
> and then set the global addresses either randomly or via RFC 7217.
The method you mentioned can also solve the current problem, but it
seems to introduce more logic:
(1) set the cellular interface addr_gen_mode to RANDOM_LL_TOKEN or PRIVACY_LL_TOKEN;
(2) set the cellular interface up;
(3) disable ipv6 first;
(4) set token addr through netlink;
(5) autoconf through the kernel;
(6) kernel trigger send RS message;
For the current patch, it is simpler, the configure process as follows:
(1) set the cellular NIC addr_gen_mode to RANDOM_NO_LLA or PRIVACY_NO_LLA;
(2) set the cellular interface up;
(3) configure the link-local addr for the NIC by ioctl;
(4) kernel trigger send RS message;
I wonder to hear what you and David think.
Thanks,
Rocco
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2021-11-17 7:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 6:09 [PATCH net-next v2] ipv6: don't generate link-local addr in random or privacy mode Rocco Yue
2021-11-16 20:21 ` David Ahern
2021-11-17 3:34 ` Jakub Kicinski
2021-11-17 5:09 ` Lorenzo Colitti
2021-11-17 7:17 ` Rocco Yue [this message]
2021-11-17 8:36 ` [PATCH net-next] " Lorenzo Colitti
2021-11-17 9:50 ` Maciej Żenczykowski
-- strict thread matches above, loose matches on Subject: below --
2021-11-17 5:59 Rocco Yue
2021-11-09 6:55 Rocco Yue
2021-11-13 8:46 ` Rocco Yue
2021-11-13 16:34 ` David Ahern
2021-11-16 2:21 ` Rocco Yue
2021-11-16 2:40 ` David Ahern
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=20211117071732.7455-1-rocco.yue@mediatek.com \
--to=rocco.yue@mediatek.com \
--cc=Rocco.Yue@gmail.com \
--cc=chao.song@mediatek.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=kuohong.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lorenzo@google.com \
--cc=markzzzsmith@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=maze@google.com \
--cc=netdev@vger.kernel.org \
--cc=yanjie.jiang@mediatek.com \
--cc=yoshfuji@linux-ipv6.org \
--cc=zhuoliang.zhang@mediatek.com \
/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