diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 84d7ebdb9d21..c8d4160385f6 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1149,6 +1149,20 @@ fail: | |||
1149 | return err; | 1149 | return err; |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | static void __exit ip6ip6_destroy_tunnels(void) | ||
1153 | { | ||
1154 | int h; | ||
1155 | struct ip6_tnl *t; | ||
1156 | |||
1157 | for (h = 0; h < HASH_SIZE; h++) { | ||
1158 | while ((t = tnls_r_l[h]) != NULL) | ||
1159 | unregister_netdevice(t->dev); | ||
1160 | } | ||
1161 | |||
1162 | t = tnls_wc[0]; | ||
1163 | unregister_netdevice(t->dev); | ||
1164 | } | ||
1165 | |||
1152 | /** | 1166 | /** |
1153 | * ip6_tunnel_cleanup - free resources and unregister protocol | 1167 | * ip6_tunnel_cleanup - free resources and unregister protocol |
1154 | **/ | 1168 | **/ |
@@ -1158,7 +1172,9 @@ static void __exit ip6_tunnel_cleanup(void) | |||
1158 | if (xfrm6_tunnel_deregister(&ip6ip6_handler)) | 1172 | if (xfrm6_tunnel_deregister(&ip6ip6_handler)) |
1159 | printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n"); | 1173 | printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n"); |
1160 | 1174 | ||
1161 | unregister_netdev(ip6ip6_fb_tnl_dev); | 1175 | rtnl_lock(); |
1176 | ip6ip6_destroy_tunnels(); | ||
1177 | rtnl_unlock(); | ||
1162 | } | 1178 | } |
1163 | 1179 | ||
1164 | module_init(ip6_tunnel_init); | 1180 | module_init(ip6_tunnel_init); |