diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-14 23:10:00 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-14 23:10:00 -0400 |
commit | 4c0e176dd5e4c44dd60f398518f75eedbe1a65f3 (patch) | |
tree | 07aea7539f78f221c6fc535a94a07befa2afdb63 /net/ipv6/sit.c | |
parent | f241be74b803dcf9d70c9978292946370654320f (diff) | |
parent | 2ba84684e8cf6f980e4e95a2300f53a505eb794e (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 b788f55e139b..e553e5b80d6e 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 | |||
195 | dev_hold(dev); | 195 | dev_hold(dev); |
196 | 196 | ||
197 | ipip6_tunnel_link(nt); | 197 | ipip6_tunnel_link(nt); |
198 | /* Do not decrement MOD_USE_COUNT here. */ | ||
199 | return nt; | 198 | return nt; |
200 | 199 | ||
201 | failed: | 200 | failed: |
@@ -794,10 +793,28 @@ static struct net_protocol sit_protocol = { | |||
794 | .err_handler = ipip6_err, | 793 | .err_handler = ipip6_err, |
795 | }; | 794 | }; |
796 | 795 | ||
796 | static void __exit sit_destroy_tunnels(void) | ||
797 | { | ||
798 | int prio; | ||
799 | |||
800 | for (prio = 1; prio < 4; prio++) { | ||
801 | int h; | ||
802 | for (h = 0; h < HASH_SIZE; h++) { | ||
803 | struct ip_tunnel *t; | ||
804 | while ((t = tunnels[prio][h]) != NULL) | ||
805 | unregister_netdevice(t->dev); | ||
806 | } | ||
807 | } | ||
808 | } | ||
809 | |||
797 | void __exit sit_cleanup(void) | 810 | void __exit sit_cleanup(void) |
798 | { | 811 | { |
799 | inet_del_protocol(&sit_protocol, IPPROTO_IPV6); | 812 | inet_del_protocol(&sit_protocol, IPPROTO_IPV6); |
800 | unregister_netdev(ipip6_fb_tunnel_dev); | 813 | |
814 | rtnl_lock(); | ||
815 | sit_destroy_tunnels(); | ||
816 | unregister_netdevice(ipip6_fb_tunnel_dev); | ||
817 | rtnl_unlock(); | ||
801 | } | 818 | } |
802 | 819 | ||
803 | int __init sit_init(void) | 820 | int __init sit_init(void) |