diff mbox series

[net-next,2/2] net: ipv6: don't generate link local address on PUREIP device

Message ID 20210128055809.31199-1-rocco.yue@mediatek.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/2] net: if_arp: add ARPHRD_PUREIP type | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Rocco Yue Jan. 28, 2021, 5:58 a.m. UTC
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(-)

Comments

Jakub Kicinski Jan. 30, 2021, 3:07 a.m. UTC | #1
On Thu, 28 Jan 2021 13:58:09 +0800 Rocco Yue wrote:
> 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>

There is no ccmni driver in the tree - is this for non-upstream
driver?
Jakub Kicinski Feb. 23, 2021, 2:45 a.m. UTC | #2
On Tue, 23 Feb 2021 10:03:11 +0800 rocco.yue wrote:
> On Thu, 2021-02-04 at 14:06 +0800, rocco.yue wrote:
> > On Fri, 2021-01-29 at 19:07 -0800, Jakub Kicinski wrote:  
> > > On Thu, 28 Jan 2021 13:58:09 +0800 Rocco Yue wrote:  
>  [...]  
> > > 
> > > There is no ccmni driver in the tree - is this for non-upstream
> > > driver?  
> > 
> > ccmni is the name of MediaTek mobile interface, currently, it is
> > non-upstream driver and we plan to upstream these driver codes this
> > year.
> > 
> > Honestly, the reason why upstreamed this patch is not only that it can
> > be used by ccmni, but also I observed that the current Linux kernel does
> > not generate ipv6 link-local address only when addr_gen_mode ==
> > IN6_ADDR_GEN_MODE_NONE. We hope kernel can add a device type so that no
> > ipv6 link-local address can be generated in any addr_gen_mode.  
> 
> gentle ping for this patch set.

We don't merge patches without upstream users.
diff mbox series

Patch

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)