Re: [PATCH net-next v10 07/13] net: ipv6: Init tunnel link-netns before registering dev

Kuniyuki Iwashima <[email protected]>
Newsgroups org.kernel.vger.linux-ppp,com.zx2c4.lists.wireguard,dev.linux.lists.bridge,org.kernel.vger.bpf,org.kernel.vger.linux-can,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-rdma,org.kernel.vger.linux-wireless,org.kernel.vger.linux-wpan,org.kernel.vger.netdev,org.open-mesh.lists.batman
Message-ID <[email protected]>
From: Xiao Liang <[email protected]>
Date: Wed, 19 Feb 2025 20:50:33 +0800
> Currently some IPv6 tunnel drivers set tnl->net to dev_net(dev) in
> ndo_init(), which is called in register_netdevice(). However, it lacks
> the context of link-netns when we enable cross-net tunnels at device
> registration time.
> 
> Let's move the init of tunnel link-netns before register_netdevice().
> 
> ip6_gre has already initialized netns, so just remove the redundant
> assignment.
> 
> Signed-off-by: Xiao Liang <[email protected]>

Reviewed-by: Kuniyuki Iwashima <[email protected]>

left a small comment, but not a blocker.


> @@ -1565,6 +1565,7 @@ static int ipip6_newlink(struct net_device *dev,
>  	int err;
>  
>  	nt = netdev_priv(dev);
> +	nt->net = net;

This hunk is not necessary as we'll call ipip6_tunnel_locate(),
but it's harmless and not worth reposting the whole series given
we are alredy in v10.  You can just post a follow-up patch after
the series is applied.

Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.