diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 85b18319e2d8..43fd9cfa7b11 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -209,8 +209,6 @@ static int ipip6_tunnel_create(struct net_device *dev) | |||
209 | 209 | ||
210 | ipip6_tunnel_clone_6rd(dev, sitn); | 210 | ipip6_tunnel_clone_6rd(dev, sitn); |
211 | 211 | ||
212 | dev_hold(dev); | ||
213 | |||
214 | ipip6_tunnel_link(sitn, t); | 212 | ipip6_tunnel_link(sitn, t); |
215 | return 0; | 213 | return 0; |
216 | 214 | ||
@@ -1393,7 +1391,7 @@ static int ipip6_tunnel_init(struct net_device *dev) | |||
1393 | dev->tstats = NULL; | 1391 | dev->tstats = NULL; |
1394 | return err; | 1392 | return err; |
1395 | } | 1393 | } |
1396 | 1394 | dev_hold(dev); | |
1397 | return 0; | 1395 | return 0; |
1398 | } | 1396 | } |
1399 | 1397 | ||
@@ -1409,7 +1407,6 @@ static void __net_init ipip6_fb_tunnel_init(struct net_device *dev) | |||
1409 | iph->ihl = 5; | 1407 | iph->ihl = 5; |
1410 | iph->ttl = 64; | 1408 | iph->ttl = 64; |
1411 | 1409 | ||
1412 | dev_hold(dev); | ||
1413 | rcu_assign_pointer(sitn->tunnels_wc[0], tunnel); | 1410 | rcu_assign_pointer(sitn->tunnels_wc[0], tunnel); |
1414 | } | 1411 | } |
1415 | 1412 | ||
@@ -1582,8 +1579,11 @@ static int ipip6_newlink(struct net *src_net, struct net_device *dev, | |||
1582 | } | 1579 | } |
1583 | 1580 | ||
1584 | #ifdef CONFIG_IPV6_SIT_6RD | 1581 | #ifdef CONFIG_IPV6_SIT_6RD |
1585 | if (ipip6_netlink_6rd_parms(data, &ip6rd)) | 1582 | if (ipip6_netlink_6rd_parms(data, &ip6rd)) { |
1586 | err = ipip6_tunnel_update_6rd(nt, &ip6rd); | 1583 | err = ipip6_tunnel_update_6rd(nt, &ip6rd); |
1584 | if (err < 0) | ||
1585 | unregister_netdevice_queue(dev, NULL); | ||
1586 | } | ||
1587 | #endif | 1587 | #endif |
1588 | 1588 | ||
1589 | return err; | 1589 | return err; |
@@ -1801,9 +1801,9 @@ static void __net_exit sit_destroy_tunnels(struct net *net, | |||
1801 | if (dev->rtnl_link_ops == &sit_link_ops) | 1801 | if (dev->rtnl_link_ops == &sit_link_ops) |
1802 | unregister_netdevice_queue(dev, head); | 1802 | unregister_netdevice_queue(dev, head); |
1803 | 1803 | ||
1804 | for (prio = 1; prio < 4; prio++) { | 1804 | for (prio = 0; prio < 4; prio++) { |
1805 | int h; | 1805 | int h; |
1806 | for (h = 0; h < IP6_SIT_HASH_SIZE; h++) { | 1806 | for (h = 0; h < (prio ? IP6_SIT_HASH_SIZE : 1); h++) { |
1807 | struct ip_tunnel *t; | 1807 | struct ip_tunnel *t; |
1808 | 1808 | ||
1809 | t = rtnl_dereference(sitn->tunnels[prio][h]); | 1809 | t = rtnl_dereference(sitn->tunnels[prio][h]); |
@@ -1858,7 +1858,6 @@ static int __net_init sit_init_net(struct net *net) | |||
1858 | return 0; | 1858 | return 0; |
1859 | 1859 | ||
1860 | err_reg_dev: | 1860 | err_reg_dev: |
1861 | ipip6_dev_free(sitn->fb_tunnel_dev); | ||
1862 | free_netdev(sitn->fb_tunnel_dev); | 1861 | free_netdev(sitn->fb_tunnel_dev); |
1863 | err_alloc_dev: | 1862 | err_alloc_dev: |
1864 | return err; | 1863 | return err; |