Skip to contentSkip to conversation

sit: set rtnl_link_ops before calling register_netdevice

PATCH Applied Thadeu Lima de Souza Cascardo 2 participants 2 messages Jan 25, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sit: set rtnl_link_ops before calling register_netdevice

When creating a SIT tunnel with ip tunnel, rtnl_link_ops is not set before ipip6_tunnel_create is called. When register_netdevice is called, there is no linkinfo attribute in the NEWLINK message because of that.

Setting rtnl_link_ops before calling register_netdevice fixes that.

---
 net/ipv6/sit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/sit.c +2 -2
index e794ef6..2066d1c 100644
@@ -201,14 +201,14 @@ static int ipip6_tunnel_create(struct net_device *dev)
 	if ((__force u16)t->parms.i_flags & SIT_ISATAP)
 		dev->priv_flags |= IFF_ISATAP;
 
+	dev->rtnl_link_ops = &sit_link_ops;
+
 	err = register_netdevice(dev);
 	if (err < 0)
 		goto out;
 
 	ipip6_tunnel_clone_6rd(dev, sitn);
 
-	dev->rtnl_link_ops = &sit_link_ops;
-
 	dev_hold(dev);
 
 	ipip6_tunnel_link(sitn, t);
Signature · 1 line
2.5.0
maintainer Applied
#1 lore raw

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Mon, 25 Jan 2016 11:29:19 -0200

Quoted 7 lines

When creating a SIT tunnel with ip tunnel, rtnl_link_ops is not set before ipip6_tunnel_create is called. When register_netdevice is called, there is no linkinfo attribute in the NEWLINK message because of that.

Setting rtnl_link_ops before calling register_netdevice fixes that.

Applied.