diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-11 00:07:03 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-11 00:07:03 -0400 |
commit | cd04b947bc674f8fc9cac38ec30497bae5d664ad (patch) | |
tree | 988b0b7ea08063e5499672346eb2f619f0629717 /net/ipv6/sit.c | |
parent | b3df9f813bc7b9db62ae0c90b8990b1cebf97345 (diff) | |
parent | bc68552faad0e134eb22281343d5ae5a4873fa80 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index b788f55e139..e553e5b80d6 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -195,7 +195,6 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int dev_hold(dev); ipip6_tunnel_link(nt); - /* Do not decrement MOD_USE_COUNT here. */ return nt; failed: @@ -794,10 +793,28 @@ static struct net_protocol sit_protocol = { .err_handler = ipip6_err, }; +static void __exit sit_destroy_tunnels(void) +{ + int prio; + + for (prio = 1; prio < 4; prio++) { + int h; + for (h = 0; h < HASH_SIZE; h++) { + struct ip_tunnel *t; + while ((t = tunnels[prio][h]) != NULL) + unregister_netdevice(t->dev); + } + } +} + void __exit sit_cleanup(void) { inet_del_protocol(&sit_protocol, IPPROTO_IPV6); - unregister_netdev(ipip6_fb_tunnel_dev); + + rtnl_lock(); + sit_destroy_tunnels(); + unregister_netdevice(ipip6_fb_tunnel_dev); + rtnl_unlock(); } int __init sit_init(void) |