Re: [PATCH net-next v2] ipv6: don't generate link-local addr in random or privacy mode
From: David Ahern
Date: Tue Nov 16 2021 - 15:21:19 EST
On 11/15/21 11:09 PM, Rocco Yue 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. The GGSN ensures the uniqueness of this Interface-Identifier.
> The MT shall then enforce the use of this Interface-Identifier by
> the TE"
> In other words, in the cellular network, GGSN determines whether
> to reply a solicited RA message by identifying the bottom 64 bits
> of the source address of the received RS message. Therefore,
> cellular network device's ipv6 link-local address should be set
> as the format of fe80::(GGSN assigned IID).
> To meet the above spec requirement, this patch adds two new
> 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.
> 2) IN6_ADDR_GEN_MODE_RANDOM_NO_LLA, in this mode, the kernel
> doesn't generate a link-local address for the cellular NIC,
> and will use the bottom 64 bits of the link-local address(same
> as the IID assigned by GGSN) to form an ipv6 global address
> after receiveing the RA message.
> Signed-off-by: Rocco Yue <rocco.yue@xxxxxxxxxxxx>
> v1->v2: Add new addr_gen_mode instead of adding a separate sysctl.
> v1 link:
> include/uapi/linux/if_link.h | 2 ++
> net/ipv6/addrconf.c | 22 ++++++++++++++++------
> tools/include/uapi/linux/if_link.h | 2 ++
> 3 files changed, 20 insertions(+), 6 deletions(-)
Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>
you should add tests under tools/testing/selftests/net.