Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5588756pxj; Wed, 23 Jun 2021 04:51:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywefkxRQTj1J2KGiHIju7rnCY5Zw9+ikTnxTSGSO8+8WpyhKlG5vq9Q/iSFhwB1slsy/A4 X-Received: by 2002:a17:907:98f6:: with SMTP id ke22mr9483581ejc.533.1624449083525; Wed, 23 Jun 2021 04:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624449083; cv=none; d=google.com; s=arc-20160816; b=BUVFW3CO98yjdDvpa+fs5VHC3Oknx/yG4PtwZ9ns3cHtvFTvU6MS8FKbWZ/2BRaw1q 6gZ3uMHsF4xgEhlhRfVGpF0OtAh0lOzhIFkbY7EkVL2d+O5LM56YVD9DaCO0iEmbC4j+ y0mVqwHRQkPtOag0dH0TU164WSkNWRHmk+gZuLmmt2DXlmQwHu0SIaVnjQ1jCQrpyXOr NC7I63FvTFtfuEpjmdkDd80sFIMNT90E+3lCWBIZljkEY0DMUDi0bJ7t3GKdhRBru+Iy T+YLahmwFEEX52DEQfN+TANG425PHBp7CsT0Zq+lEpe8y93LtcH/a2fAAAhBz+n0ty4J 7lIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=pEg6m4yFhrCXEspi9JwTBu754Ly8J/21JRl/sq+Sx4s=; b=fzP12rwoohUvmHi6V+Sn+z1JtrWt7e4VyDlq5oRRaEpyI2q2IFZcq2OgyFnWdBGdf9 PBUSYN/HLacP/khThJwkKfEQS6wJcJOmBCQZQ6VH7IgcwY2yfc+tWaGZXYLfVSgXEYHY PRnZgYUrj63fgDuPv/7FCBqvpMu3Ws6iUZHZLWKhoh0qxbq2lyMWBV3WEtbsG3LgnudF yvNEfCV0JEDe1SZtwvpZNvJpSSt2uMBJP1ZEngYGWP53IVXuC6AIZi3eNFeChgD+I6If HUOCzgYOpuhhK+JG5UKhAzLnLWDnQ/3iyFpMIcX8kNhgxQHzyyQTSOpPwOwsvvnQoeJm V3aQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e12si17046820ejy.258.2021.06.23.04.51.01; Wed, 23 Jun 2021 04:51:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230326AbhFWLwK (ORCPT + 99 others); Wed, 23 Jun 2021 07:52:10 -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 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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) -- 2.18.0