Skip to content

Commit

Permalink
vti6: Use vti6_dev_init as the ndo_init function.
Browse files Browse the repository at this point in the history
vti6_dev_init() sets the dev->iflink via a call to
vti6_link_config(). After that, register_netdevice()
sets dev->iflink = -1. So we loose the iflink configuration
for vti6 tunnels. Fix this by using vti6_dev_init() as the
ndo_init function. Then vti6_dev_init() is called after
dev->iflink is set to -1 from register_netdevice().

Signed-off-by: Steffen Klassert <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
klassert authored and davem330 committed Nov 3, 2014
1 parent 6c6151d commit 16a0231
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions net/ipv6/ip6_vti.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ static int vti6_tnl_create2(struct net_device *dev)
struct vti6_net *ip6n = net_generic(net, vti6_net_id);
int err;

err = vti6_dev_init(dev);
if (err < 0)
goto out;

err = register_netdevice(dev);
if (err < 0)
goto out;
Expand Down Expand Up @@ -783,6 +779,7 @@ static int vti6_change_mtu(struct net_device *dev, int new_mtu)
}

static const struct net_device_ops vti6_netdev_ops = {
.ndo_init = vti6_dev_init,
.ndo_uninit = vti6_dev_uninit,
.ndo_start_xmit = vti6_tnl_xmit,
.ndo_do_ioctl = vti6_ioctl,
Expand Down Expand Up @@ -852,16 +849,10 @@ static int __net_init vti6_fb_tnl_dev_init(struct net_device *dev)
struct ip6_tnl *t = netdev_priv(dev);
struct net *net = dev_net(dev);
struct vti6_net *ip6n = net_generic(net, vti6_net_id);
int err = vti6_dev_init_gen(dev);

if (err)
return err;

t->parms.proto = IPPROTO_IPV6;
dev_hold(dev);

vti6_link_config(t);

rcu_assign_pointer(ip6n->tnls_wc[0], t);
return 0;
}
Expand Down

0 comments on commit 16a0231

Please sign in to comment.