diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 3a9038dd818d..5a57f38a50d5 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -1604,6 +1604,15 @@ static const struct nla_policy ipip6_policy[IFLA_IPTUN_MAX + 1] = { | |||
1604 | #endif | 1604 | #endif |
1605 | }; | 1605 | }; |
1606 | 1606 | ||
1607 | static void ipip6_dellink(struct net_device *dev, struct list_head *head) | ||
1608 | { | ||
1609 | struct net *net = dev_net(dev); | ||
1610 | struct sit_net *sitn = net_generic(net, sit_net_id); | ||
1611 | |||
1612 | if (dev != sitn->fb_tunnel_dev) | ||
1613 | unregister_netdevice_queue(dev, head); | ||
1614 | } | ||
1615 | |||
1607 | static struct rtnl_link_ops sit_link_ops __read_mostly = { | 1616 | static struct rtnl_link_ops sit_link_ops __read_mostly = { |
1608 | .kind = "sit", | 1617 | .kind = "sit", |
1609 | .maxtype = IFLA_IPTUN_MAX, | 1618 | .maxtype = IFLA_IPTUN_MAX, |
@@ -1615,6 +1624,7 @@ static struct rtnl_link_ops sit_link_ops __read_mostly = { | |||
1615 | .changelink = ipip6_changelink, | 1624 | .changelink = ipip6_changelink, |
1616 | .get_size = ipip6_get_size, | 1625 | .get_size = ipip6_get_size, |
1617 | .fill_info = ipip6_fill_info, | 1626 | .fill_info = ipip6_fill_info, |
1627 | .dellink = ipip6_dellink, | ||
1618 | }; | 1628 | }; |
1619 | 1629 | ||
1620 | static struct xfrm_tunnel sit_handler __read_mostly = { | 1630 | static struct xfrm_tunnel sit_handler __read_mostly = { |
@@ -1629,9 +1639,10 @@ static struct xfrm_tunnel ipip_handler __read_mostly = { | |||
1629 | .priority = 2, | 1639 | .priority = 2, |
1630 | }; | 1640 | }; |
1631 | 1641 | ||
1632 | static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_head *head) | 1642 | static void __net_exit sit_destroy_tunnels(struct net *net, |
1643 | struct list_head *head) | ||
1633 | { | 1644 | { |
1634 | struct net *net = dev_net(sitn->fb_tunnel_dev); | 1645 | struct sit_net *sitn = net_generic(net, sit_net_id); |
1635 | struct net_device *dev, *aux; | 1646 | struct net_device *dev, *aux; |
1636 | int prio; | 1647 | int prio; |
1637 | 1648 | ||
@@ -1706,11 +1717,10 @@ err_alloc_dev: | |||
1706 | 1717 | ||
1707 | static void __net_exit sit_exit_net(struct net *net) | 1718 | static void __net_exit sit_exit_net(struct net *net) |
1708 | { | 1719 | { |
1709 | struct sit_net *sitn = net_generic(net, sit_net_id); | ||
1710 | LIST_HEAD(list); | 1720 | LIST_HEAD(list); |
1711 | 1721 | ||
1712 | rtnl_lock(); | 1722 | rtnl_lock(); |
1713 | sit_destroy_tunnels(sitn, &list); | 1723 | sit_destroy_tunnels(net, &list); |
1714 | unregister_netdevice_many(&list); | 1724 | unregister_netdevice_many(&list); |
1715 | rtnl_unlock(); | 1725 | rtnl_unlock(); |
1716 | } | 1726 | } |