提交 b3fdd9f1 编写于 作者: Y Yasuyuki Kozakai 提交者: David S. Miller

[IPV6] IP6TUNNEL: Delete all tunnel device when unloading module.

Signed-off-by: NYasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
上级 ea659e07
......@@ -1149,6 +1149,20 @@ static int __init ip6_tunnel_init(void)
return err;
}
static void __exit ip6ip6_destroy_tunnels(void)
{
int h;
struct ip6_tnl *t;
for (h = 0; h < HASH_SIZE; h++) {
while ((t = tnls_r_l[h]) != NULL)
unregister_netdevice(t->dev);
}
t = tnls_wc[0];
unregister_netdevice(t->dev);
}
/**
* ip6_tunnel_cleanup - free resources and unregister protocol
**/
......@@ -1158,7 +1172,9 @@ static void __exit ip6_tunnel_cleanup(void)
if (xfrm6_tunnel_deregister(&ip6ip6_handler))
printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
unregister_netdev(ip6ip6_fb_tnl_dev);
rtnl_lock();
ip6ip6_destroy_tunnels();
rtnl_unlock();
}
module_init(ip6_tunnel_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册