From patchwork Wed Jun 23 11:34:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rocco Yue X-Patchwork-Id: 12339709 X-Patchwork-Delegate: kuba@kernel.org 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham 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 E0DB6C48BE5 for ; Wed, 23 Jun 2021 11:49:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDA546102A for ; Wed, 23 Jun 2021 11:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbhFWLwJ (ORCPT ); Wed, 23 Jun 2021 07:52:09 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:55218 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230291AbhFWLwI (ORCPT ); Wed, 23 Jun 2021 07:52:08 -0400 X-UUID: 64b6003317444b0bac0b4a68d87a33a5-20210623 X-UUID: 64b6003317444b0bac0b4a68d87a33a5-20210623 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1990726428; Wed, 23 Jun 2021 19:49:49 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 23 Jun 2021 19:49:47 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 23 Jun 2021 19:49:46 +0800 From: Rocco Yue To: "David S . Miller" , Jakub Kicinski , Jonathan Corbet , Hideaki YOSHIFUJI , David Ahern , Matthias Brugger , Felix Fietkau , John Crispin , Sean Wang , Mark Lee CC: , , , , , , , , , , Rocco Yue Subject: [PATCH 2/4] net: ipv6: don't generate link local address on PUREIP device Date: Wed, 23 Jun 2021 19:34:50 +0800 Message-ID: <20210623113452.5671-2-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210623113452.5671-1-rocco.yue@mediatek.com> References: <20210623113452.5671-1-rocco.yue@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org PUREIP device such as ccmni does not need kernel to generate ipv6 link-local address in any addr_gen_mode, generally, it shall use the IPv6 Interface Identifier, as provided by the GGSN, to create its IPv6 link-ocal Unicast Address. Signed-off-by: Rocco Yue --- net/ipv6/addrconf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 701eb82acd1c..1bfa7eca1314 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3339,7 +3339,8 @@ static void addrconf_dev_config(struct net_device *dev) (dev->type != ARPHRD_IPGRE) && (dev->type != ARPHRD_TUNNEL) && (dev->type != ARPHRD_NONE) && - (dev->type != ARPHRD_RAWIP)) { + (dev->type != ARPHRD_RAWIP) && + (dev->type != ARPHRD_PUREIP)) { /* Alas, we support only Ethernet autoconfiguration. */ idev = __in6_dev_get(dev); if (!IS_ERR_OR_NULL(idev) && dev->flags & IFF_UP && @@ -3352,6 +3353,12 @@ static void addrconf_dev_config(struct net_device *dev) if (IS_ERR(idev)) return; + /* this device type doesn't need to generate + * link-local address in any addr_gen_mode + */ + if (dev->type == ARPHRD_PUREIP) + return; + /* this device type has no EUI support */ if (dev->type == ARPHRD_NONE && idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64)