aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/ip6_tunnel.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 583b77e2f69b..c1e11b5d6ccc 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1635,6 +1635,15 @@ static int ip6_tnl_changelink(struct net_device *dev, struct nlattr *tb[],
1635 return ip6_tnl_update(t, &p); 1635 return ip6_tnl_update(t, &p);
1636} 1636}
1637 1637
1638static void ip6_tnl_dellink(struct net_device *dev, struct list_head *head)
1639{
1640 struct net *net = dev_net(dev);
1641 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1642
1643 if (dev != ip6n->fb_tnl_dev)
1644 unregister_netdevice_queue(dev, head);
1645}
1646
1638static size_t ip6_tnl_get_size(const struct net_device *dev) 1647static size_t ip6_tnl_get_size(const struct net_device *dev)
1639{ 1648{
1640 return 1649 return
@@ -1699,6 +1708,7 @@ static struct rtnl_link_ops ip6_link_ops __read_mostly = {
1699 .validate = ip6_tnl_validate, 1708 .validate = ip6_tnl_validate,
1700 .newlink = ip6_tnl_newlink, 1709 .newlink = ip6_tnl_newlink,
1701 .changelink = ip6_tnl_changelink, 1710 .changelink = ip6_tnl_changelink,
1711 .dellink = ip6_tnl_dellink,
1702 .get_size = ip6_tnl_get_size, 1712 .get_size = ip6_tnl_get_size,
1703 .fill_info = ip6_tnl_fill_info, 1713 .fill_info = ip6_tnl_fill_info,
1704}; 1714};
@@ -1715,9 +1725,9 @@ static struct xfrm6_tunnel ip6ip6_handler __read_mostly = {
1715 .priority = 1, 1725 .priority = 1,
1716}; 1726};
1717 1727
1718static void __net_exit ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n) 1728static void __net_exit ip6_tnl_destroy_tunnels(struct net *net)
1719{ 1729{
1720 struct net *net = dev_net(ip6n->fb_tnl_dev); 1730 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1721 struct net_device *dev, *aux; 1731 struct net_device *dev, *aux;
1722 int h; 1732 int h;
1723 struct ip6_tnl *t; 1733 struct ip6_tnl *t;
@@ -1785,10 +1795,8 @@ err_alloc_dev:
1785 1795
1786static void __net_exit ip6_tnl_exit_net(struct net *net) 1796static void __net_exit ip6_tnl_exit_net(struct net *net)
1787{ 1797{
1788 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1789
1790 rtnl_lock(); 1798 rtnl_lock();
1791 ip6_tnl_destroy_tunnels(ip6n); 1799 ip6_tnl_destroy_tunnels(net);
1792 rtnl_unlock(); 1800 rtnl_unlock();
1793} 1801}
1794 1802