diff options
author | David S. Miller <davem@davemloft.net> | 2014-11-06 22:01:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-06 22:01:18 -0500 |
commit | 4e84b496fd2a226883920e0e0de4ed3f94898adf (patch) | |
tree | 662e314870fabf5d6e3bf25b955bd537eb72de54 /net/ipv6 | |
parent | 5c91ae08e4500ebc8efd584c8b87c4040d5393ea (diff) | |
parent | 9d01412ae76fec5274a3d94a28a3552a742a60dc (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_gre.c | 5 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 10 | ||||
-rw-r--r-- | net/ipv6/ip6_vti.c | 11 | ||||
-rw-r--r-- | net/ipv6/sit.c | 15 |
4 files changed, 11 insertions, 30 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 1fcf62ea5eb4..f6e2533c1145 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -961,8 +961,6 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) | |||
961 | else | 961 | else |
962 | dev->flags &= ~IFF_POINTOPOINT; | 962 | dev->flags &= ~IFF_POINTOPOINT; |
963 | 963 | ||
964 | dev->iflink = p->link; | ||
965 | |||
966 | /* Precalculate GRE options length */ | 964 | /* Precalculate GRE options length */ |
967 | if (t->parms.o_flags&(GRE_CSUM|GRE_KEY|GRE_SEQ)) { | 965 | if (t->parms.o_flags&(GRE_CSUM|GRE_KEY|GRE_SEQ)) { |
968 | if (t->parms.o_flags&GRE_CSUM) | 966 | if (t->parms.o_flags&GRE_CSUM) |
@@ -1272,6 +1270,7 @@ static int ip6gre_tunnel_init(struct net_device *dev) | |||
1272 | u64_stats_init(&ip6gre_tunnel_stats->syncp); | 1270 | u64_stats_init(&ip6gre_tunnel_stats->syncp); |
1273 | } | 1271 | } |
1274 | 1272 | ||
1273 | dev->iflink = tunnel->parms.link; | ||
1275 | 1274 | ||
1276 | return 0; | 1275 | return 0; |
1277 | } | 1276 | } |
@@ -1481,6 +1480,8 @@ static int ip6gre_tap_init(struct net_device *dev) | |||
1481 | if (!dev->tstats) | 1480 | if (!dev->tstats) |
1482 | return -ENOMEM; | 1481 | return -ENOMEM; |
1483 | 1482 | ||
1483 | dev->iflink = tunnel->parms.link; | ||
1484 | |||
1484 | return 0; | 1485 | return 0; |
1485 | } | 1486 | } |
1486 | 1487 | ||
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 4550d08f44de..e2b6cfba873c 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -289,9 +289,6 @@ static int ip6_tnl_create2(struct net_device *dev) | |||
289 | int err; | 289 | int err; |
290 | 290 | ||
291 | t = netdev_priv(dev); | 291 | t = netdev_priv(dev); |
292 | err = ip6_tnl_dev_init(dev); | ||
293 | if (err < 0) | ||
294 | goto out; | ||
295 | 292 | ||
296 | err = register_netdevice(dev); | 293 | err = register_netdevice(dev); |
297 | if (err < 0) | 294 | if (err < 0) |
@@ -1526,6 +1523,7 @@ ip6_tnl_change_mtu(struct net_device *dev, int new_mtu) | |||
1526 | 1523 | ||
1527 | 1524 | ||
1528 | static const struct net_device_ops ip6_tnl_netdev_ops = { | 1525 | static const struct net_device_ops ip6_tnl_netdev_ops = { |
1526 | .ndo_init = ip6_tnl_dev_init, | ||
1529 | .ndo_uninit = ip6_tnl_dev_uninit, | 1527 | .ndo_uninit = ip6_tnl_dev_uninit, |
1530 | .ndo_start_xmit = ip6_tnl_xmit, | 1528 | .ndo_start_xmit = ip6_tnl_xmit, |
1531 | .ndo_do_ioctl = ip6_tnl_ioctl, | 1529 | .ndo_do_ioctl = ip6_tnl_ioctl, |
@@ -1610,16 +1608,10 @@ static int __net_init ip6_fb_tnl_dev_init(struct net_device *dev) | |||
1610 | struct ip6_tnl *t = netdev_priv(dev); | 1608 | struct ip6_tnl *t = netdev_priv(dev); |
1611 | struct net *net = dev_net(dev); | 1609 | struct net *net = dev_net(dev); |
1612 | struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); | 1610 | struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); |
1613 | int err = ip6_tnl_dev_init_gen(dev); | ||
1614 | |||
1615 | if (err) | ||
1616 | return err; | ||
1617 | 1611 | ||
1618 | t->parms.proto = IPPROTO_IPV6; | 1612 | t->parms.proto = IPPROTO_IPV6; |
1619 | dev_hold(dev); | 1613 | dev_hold(dev); |
1620 | 1614 | ||
1621 | ip6_tnl_link_config(t); | ||
1622 | |||
1623 | rcu_assign_pointer(ip6n->tnls_wc[0], t); | 1615 | rcu_assign_pointer(ip6n->tnls_wc[0], t); |
1624 | return 0; | 1616 | return 0; |
1625 | } | 1617 | } |
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index 0e8e97e0d38b..ec84d03491c7 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c | |||
@@ -172,10 +172,6 @@ static int vti6_tnl_create2(struct net_device *dev) | |||
172 | struct vti6_net *ip6n = net_generic(net, vti6_net_id); | 172 | struct vti6_net *ip6n = net_generic(net, vti6_net_id); |
173 | int err; | 173 | int err; |
174 | 174 | ||
175 | err = vti6_dev_init(dev); | ||
176 | if (err < 0) | ||
177 | goto out; | ||
178 | |||
179 | err = register_netdevice(dev); | 175 | err = register_netdevice(dev); |
180 | if (err < 0) | 176 | if (err < 0) |
181 | goto out; | 177 | goto out; |
@@ -789,6 +785,7 @@ static int vti6_change_mtu(struct net_device *dev, int new_mtu) | |||
789 | } | 785 | } |
790 | 786 | ||
791 | static const struct net_device_ops vti6_netdev_ops = { | 787 | static const struct net_device_ops vti6_netdev_ops = { |
788 | .ndo_init = vti6_dev_init, | ||
792 | .ndo_uninit = vti6_dev_uninit, | 789 | .ndo_uninit = vti6_dev_uninit, |
793 | .ndo_start_xmit = vti6_tnl_xmit, | 790 | .ndo_start_xmit = vti6_tnl_xmit, |
794 | .ndo_do_ioctl = vti6_ioctl, | 791 | .ndo_do_ioctl = vti6_ioctl, |
@@ -858,16 +855,10 @@ static int __net_init vti6_fb_tnl_dev_init(struct net_device *dev) | |||
858 | struct ip6_tnl *t = netdev_priv(dev); | 855 | struct ip6_tnl *t = netdev_priv(dev); |
859 | struct net *net = dev_net(dev); | 856 | struct net *net = dev_net(dev); |
860 | struct vti6_net *ip6n = net_generic(net, vti6_net_id); | 857 | struct vti6_net *ip6n = net_generic(net, vti6_net_id); |
861 | int err = vti6_dev_init_gen(dev); | ||
862 | |||
863 | if (err) | ||
864 | return err; | ||
865 | 858 | ||
866 | t->parms.proto = IPPROTO_IPV6; | 859 | t->parms.proto = IPPROTO_IPV6; |
867 | dev_hold(dev); | 860 | dev_hold(dev); |
868 | 861 | ||
869 | vti6_link_config(t); | ||
870 | |||
871 | rcu_assign_pointer(ip6n->tnls_wc[0], t); | 862 | rcu_assign_pointer(ip6n->tnls_wc[0], t); |
872 | return 0; | 863 | return 0; |
873 | } | 864 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 45ad92442cd5..660496de6125 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -195,10 +195,8 @@ static int ipip6_tunnel_create(struct net_device *dev) | |||
195 | struct sit_net *sitn = net_generic(net, sit_net_id); | 195 | struct sit_net *sitn = net_generic(net, sit_net_id); |
196 | int err; | 196 | int err; |
197 | 197 | ||
198 | err = ipip6_tunnel_init(dev); | 198 | memcpy(dev->dev_addr, &t->parms.iph.saddr, 4); |
199 | if (err < 0) | 199 | memcpy(dev->broadcast, &t->parms.iph.daddr, 4); |
200 | goto out; | ||
201 | ipip6_tunnel_clone_6rd(dev, sitn); | ||
202 | 200 | ||
203 | if ((__force u16)t->parms.i_flags & SIT_ISATAP) | 201 | if ((__force u16)t->parms.i_flags & SIT_ISATAP) |
204 | dev->priv_flags |= IFF_ISATAP; | 202 | dev->priv_flags |= IFF_ISATAP; |
@@ -207,7 +205,8 @@ static int ipip6_tunnel_create(struct net_device *dev) | |||
207 | if (err < 0) | 205 | if (err < 0) |
208 | goto out; | 206 | goto out; |
209 | 207 | ||
210 | strcpy(t->parms.name, dev->name); | 208 | ipip6_tunnel_clone_6rd(dev, sitn); |
209 | |||
211 | dev->rtnl_link_ops = &sit_link_ops; | 210 | dev->rtnl_link_ops = &sit_link_ops; |
212 | 211 | ||
213 | dev_hold(dev); | 212 | dev_hold(dev); |
@@ -1330,6 +1329,7 @@ static int ipip6_tunnel_change_mtu(struct net_device *dev, int new_mtu) | |||
1330 | } | 1329 | } |
1331 | 1330 | ||
1332 | static const struct net_device_ops ipip6_netdev_ops = { | 1331 | static const struct net_device_ops ipip6_netdev_ops = { |
1332 | .ndo_init = ipip6_tunnel_init, | ||
1333 | .ndo_uninit = ipip6_tunnel_uninit, | 1333 | .ndo_uninit = ipip6_tunnel_uninit, |
1334 | .ndo_start_xmit = sit_tunnel_xmit, | 1334 | .ndo_start_xmit = sit_tunnel_xmit, |
1335 | .ndo_do_ioctl = ipip6_tunnel_ioctl, | 1335 | .ndo_do_ioctl = ipip6_tunnel_ioctl, |
@@ -1378,9 +1378,7 @@ static int ipip6_tunnel_init(struct net_device *dev) | |||
1378 | 1378 | ||
1379 | tunnel->dev = dev; | 1379 | tunnel->dev = dev; |
1380 | tunnel->net = dev_net(dev); | 1380 | tunnel->net = dev_net(dev); |
1381 | 1381 | strcpy(tunnel->parms.name, dev->name); | |
1382 | memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4); | ||
1383 | memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4); | ||
1384 | 1382 | ||
1385 | ipip6_tunnel_bind_dev(dev); | 1383 | ipip6_tunnel_bind_dev(dev); |
1386 | dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); | 1384 | dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); |
@@ -1405,7 +1403,6 @@ static int __net_init ipip6_fb_tunnel_init(struct net_device *dev) | |||
1405 | 1403 | ||
1406 | tunnel->dev = dev; | 1404 | tunnel->dev = dev; |
1407 | tunnel->net = dev_net(dev); | 1405 | tunnel->net = dev_net(dev); |
1408 | strcpy(tunnel->parms.name, dev->name); | ||
1409 | 1406 | ||
1410 | iph->version = 4; | 1407 | iph->version = 4; |
1411 | iph->protocol = IPPROTO_IPV6; | 1408 | iph->protocol = IPPROTO_IPV6; |