From patchwork Thu Jan 28 05:56:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rocco Yue X-Patchwork-Id: 12051917 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,URIBL_BLOCKED, 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 CA0E4C433E9 for ; Thu, 28 Jan 2021 06:10:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8734D64DDD for ; Thu, 28 Jan 2021 06:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231263AbhA1GKF (ORCPT ); Thu, 28 Jan 2021 01:10:05 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:40644 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229847AbhA1GKC (ORCPT ); Thu, 28 Jan 2021 01:10:02 -0500 X-UUID: 542e0c67a5044297abde6c604f87533e-20210128 X-UUID: 542e0c67a5044297abde6c604f87533e-20210128 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2071832710; Thu, 28 Jan 2021 14:09:20 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 28 Jan 2021 14:09:19 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 28 Jan 2021 14:09:19 +0800 From: Rocco Yue To: "David S . Miller" , Jakub Kicinski , Matthias Brugger CC: , , , , , Rocco Yue Subject: [PATCH net-next 1/2] net: if_arp: add ARPHRD_PUREIP type Date: Thu, 28 Jan 2021 13:56:45 +0800 Message-ID: <20210128055645.14810-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch add the definition of ARPHRD_PUREIP which can for example be used by mobile ccmni device as device type. ARPHRD_PUREIP means that this device doesn't need kernel to generate the link-local address in any addr_gen_mode. Signed-off-by: Rocco Yue --- include/uapi/linux/if_arp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h index c3cc5a9e5eaf..3602fc3d9488 100644 --- a/include/uapi/linux/if_arp.h +++ b/include/uapi/linux/if_arp.h @@ -61,6 +61,7 @@ #define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ #define ARPHRD_RAWHDLC 518 /* Raw HDLC */ #define ARPHRD_RAWIP 519 /* Raw IP */ +#define ARPHRD_PUREIP 520 /* PURE IP */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ #define ARPHRD_TUNNEL6 769 /* IP6IP6 tunnel */ From patchwork Thu Jan 28 05:58:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rocco Yue X-Patchwork-Id: 12051919 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,URIBL_BLOCKED, 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 7ADB2C433E6 for ; Thu, 28 Jan 2021 06:11:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 344BE64DD6 for ; Thu, 28 Jan 2021 06:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231336AbhA1GLa (ORCPT ); Thu, 28 Jan 2021 01:11:30 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:52571 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231317AbhA1GL2 (ORCPT ); Thu, 28 Jan 2021 01:11:28 -0500 X-UUID: b750d5c8d9ce4689b0573bbc227ffbec-20210128 X-UUID: b750d5c8d9ce4689b0573bbc227ffbec-20210128 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 523626734; Thu, 28 Jan 2021 14:10:43 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 28 Jan 2021 14:10:39 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 28 Jan 2021 14:10:39 +0800 From: Rocco Yue To: "David S . Miller" , Hideaki YOSHIFUJI , Jakub Kicinski , Matthias Brugger CC: , , , , , Rocco Yue Subject: [PATCH net-next 2/2] net: ipv6: don't generate link local address on PUREIP device Date: Thu, 28 Jan 2021 13:58:09 +0800 Message-ID: <20210128055809.31199-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: 7B2B7C4553CCBA3F7B9FFADABE25EC8F855F847BDA9C4A9AB060FB4FE6B5835C2000:8 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org PUREIP device such as ccmni does not need kernel to generate 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 9edc5bb2d531..5e8134d3e704 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3337,7 +3337,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 && @@ -3350,6 +3351,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)