]>
Commit | Line | Data |
---|---|---|
dd6ffc36 GKH |
1 | From foo@baz Tue Nov 18 09:07:38 PST 2014 |
2 | From: Steffen Klassert <steffen.klassert@secunet.com> | |
3 | Date: Mon, 3 Nov 2014 09:19:28 +0100 | |
4 | Subject: vti6: Use vti6_dev_init as the ndo_init function. | |
5 | ||
6 | From: Steffen Klassert <steffen.klassert@secunet.com> | |
7 | ||
8 | [ Upstream commit 16a0231bf7dc3fb37e9b1f1cb1a277dc220b5c5e ] | |
9 | ||
10 | vti6_dev_init() sets the dev->iflink via a call to | |
11 | vti6_link_config(). After that, register_netdevice() | |
12 | sets dev->iflink = -1. So we loose the iflink configuration | |
13 | for vti6 tunnels. Fix this by using vti6_dev_init() as the | |
14 | ndo_init function. Then vti6_dev_init() is called after | |
15 | dev->iflink is set to -1 from register_netdevice(). | |
16 | ||
17 | Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> | |
18 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
20 | --- | |
21 | net/ipv6/ip6_vti.c | 11 +---------- | |
22 | 1 file changed, 1 insertion(+), 10 deletions(-) | |
23 | ||
24 | --- a/net/ipv6/ip6_vti.c | |
25 | +++ b/net/ipv6/ip6_vti.c | |
26 | @@ -172,10 +172,6 @@ static int vti6_tnl_create2(struct net_d | |
27 | struct vti6_net *ip6n = net_generic(net, vti6_net_id); | |
28 | int err; | |
29 | ||
30 | - err = vti6_dev_init(dev); | |
31 | - if (err < 0) | |
32 | - goto out; | |
33 | - | |
34 | err = register_netdevice(dev); | |
35 | if (err < 0) | |
36 | goto out; | |
37 | @@ -693,6 +689,7 @@ static int vti6_change_mtu(struct net_de | |
38 | } | |
39 | ||
40 | static const struct net_device_ops vti6_netdev_ops = { | |
41 | + .ndo_init = vti6_dev_init, | |
42 | .ndo_uninit = vti6_dev_uninit, | |
43 | .ndo_start_xmit = vti6_tnl_xmit, | |
44 | .ndo_do_ioctl = vti6_ioctl, | |
45 | @@ -772,16 +769,10 @@ static int __net_init vti6_fb_tnl_dev_in | |
46 | struct ip6_tnl *t = netdev_priv(dev); | |
47 | struct net *net = dev_net(dev); | |
48 | struct vti6_net *ip6n = net_generic(net, vti6_net_id); | |
49 | - int err = vti6_dev_init_gen(dev); | |
50 | - | |
51 | - if (err) | |
52 | - return err; | |
53 | ||
54 | t->parms.proto = IPPROTO_IPV6; | |
55 | dev_hold(dev); | |
56 | ||
57 | - vti6_link_config(t); | |
58 | - | |
59 | rcu_assign_pointer(ip6n->tnls_wc[0], t); | |
60 | return 0; | |
61 | } |