diff options
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 3bd69988bccf..a2ca53da4372 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -754,16 +754,19 @@ static struct xfrm_tunnel ipip_handler = { | |||
754 | static const char banner[] __initconst = | 754 | static const char banner[] __initconst = |
755 | KERN_INFO "IPv4 over IPv4 tunneling driver\n"; | 755 | KERN_INFO "IPv4 over IPv4 tunneling driver\n"; |
756 | 756 | ||
757 | static void ipip_destroy_tunnels(struct ipip_net *ipn) | 757 | static void ipip_destroy_tunnels(struct ipip_net *ipn, struct list_head *head) |
758 | { | 758 | { |
759 | int prio; | 759 | int prio; |
760 | 760 | ||
761 | for (prio = 1; prio < 4; prio++) { | 761 | for (prio = 1; prio < 4; prio++) { |
762 | int h; | 762 | int h; |
763 | for (h = 0; h < HASH_SIZE; h++) { | 763 | for (h = 0; h < HASH_SIZE; h++) { |
764 | struct ip_tunnel *t; | 764 | struct ip_tunnel *t = ipn->tunnels[prio][h]; |
765 | while ((t = ipn->tunnels[prio][h]) != NULL) | 765 | |
766 | unregister_netdevice(t->dev); | 766 | while (t != NULL) { |
767 | unregister_netdevice_queue(t->dev, head); | ||
768 | t = t->next; | ||
769 | } | ||
767 | } | 770 | } |
768 | } | 771 | } |
769 | } | 772 | } |
@@ -816,11 +819,13 @@ err_alloc: | |||
816 | static void ipip_exit_net(struct net *net) | 819 | static void ipip_exit_net(struct net *net) |
817 | { | 820 | { |
818 | struct ipip_net *ipn; | 821 | struct ipip_net *ipn; |
822 | LIST_HEAD(list); | ||
819 | 823 | ||
820 | ipn = net_generic(net, ipip_net_id); | 824 | ipn = net_generic(net, ipip_net_id); |
821 | rtnl_lock(); | 825 | rtnl_lock(); |
822 | ipip_destroy_tunnels(ipn); | 826 | ipip_destroy_tunnels(ipn, &list); |
823 | unregister_netdevice(ipn->fb_tunnel_dev); | 827 | unregister_netdevice_queue(ipn->fb_tunnel_dev, &list); |
828 | unregister_netdevice_many(&list); | ||
824 | rtnl_unlock(); | 829 | rtnl_unlock(); |
825 | kfree(ipn); | 830 | kfree(ipn); |
826 | } | 831 | } |