From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B8A3C11F69 for ; Thu, 1 Jul 2021 09:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C69A614A7 for ; Thu, 1 Jul 2021 09:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235715AbhGAJJx (ORCPT ); Thu, 1 Jul 2021 05:09:53 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:36881 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S235088AbhGAJJw (ORCPT ); Thu, 1 Jul 2021 05:09:52 -0400 X-UUID: e0d9a7106c684aef81196d6e901da683-20210701 X-UUID: e0d9a7106c684aef81196d6e901da683-20210701 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2055808077; Thu, 01 Jul 2021 17:07:17 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 1 Jul 2021 17:07:09 +0800 Received: from localhost.localdomain (10.15.20.246) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 1 Jul 2021 17:07:08 +0800 From: Rocco Yue To: David Ahern CC: "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Matthias Brugger , , , , , , , , , , Rocco Yue Subject: Re: [PATCH] net: ipv6: don't generate link-local address in any addr_gen_mode Date: Thu, 1 Jul 2021 16:51:18 +0800 Message-ID: <20210701085117.19018-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <46a9dbf2-9748-330a-963e-57e615a15440@gmail.com> References: <46a9dbf2-9748-330a-963e-57e615a15440@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-06-30 at 22:41 -0600, David Ahern wrote: > On 6/30/21 9:39 PM, Rocco Yue wrote: >> >> Hi David, >> >> Thanks for your review. >> >> This patch is different with IN6_ADDR_GEN_MODE_NONE. >> >> When the addr_gen_mode == IN6_ADDR_GEN_MODE_NONE, the Linux kernel >> doesn't automatically generate the ipv6 link-local address. >> > > ... > >> >> After this patch, when the "disable_gen_linklocal_addr" value of a device >> is 1, no matter in which addr_gen_mode, the Linux kernel will not automatically >> generate an ipv6 link-local for this device. >> > > those 2 sentences are saying the same thing to me. > > for your use case, why is setting addr_gen_mode == 1 for the device not > sufficient? > For mobile operators that don't need to support RFC7217, setting addr_gen_mode == 1 is sufficient; But for some other mobile operators that need to support RFC7217, such as AT&T, the mobile device's addr_gen_mode will be switched to the IN6_ADDR_GEN_MODE_STABLE_PRIVACY, instead of using IN6_ADDR_GEN_MODE_NONE. The purpose is: in the IN6_ADDR_GEN_MODE_STABLE_PRIVACY mode, kernel can gererate a stable privacy global ipv6 address after receiveing RA, and network processes can use this global address to communicate with the outside network. Of course, mobile operators that need to support RFC7217 should also meet the requirement of 3GPP TS 29.061, that is, MT should use IID assigned by the GGSN to build its ipv6 link-local address and use this address to send RS. We don't want the kernel to automatically generate an ipv6 link-local address when addr_gen_mode == 2. Otherwise, using the stable privacy ipv6 link-local address automatically generated by the kernel to send RS message, GGSN will not be able to respond to the RS and reply a RA message. Therefore, after this patch, kernel will not generate ipv6 link-local address for the corresponding device when addr_gen_mode == 1 or addr_gen_mode == 2. Thanks, Rocco