From: Rocco Yue <rocco.yue@mediatek.com>
To: "David S . Miller" <davem@davemloft.net>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Jakub Kicinski <kuba@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>, <wsd_upstream@mediatek.com>,
Rocco Yue <rocco.yue@mediatek.com>
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 [thread overview]
Message-ID: <20210128055809.31199-1-rocco.yue@mediatek.com> (raw)
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 <rocco.yue@mediatek.com>
---
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)
--
2.18.0
next reply other threads:[~2021-01-28 6:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 5:58 Rocco Yue [this message]
2021-01-30 3:07 ` [PATCH net-next 2/2] net: ipv6: don't generate link local address on PUREIP device Jakub Kicinski
[not found] ` <1612418761.1817.19.camel@mbjsdccf07>
[not found] ` <1614045791.6614.3.camel@mbjsdccf07>
2021-02-23 2:45 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210128055809.31199-1-rocco.yue@mediatek.com \
--to=rocco.yue@mediatek.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=wsd_upstream@mediatek.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).