summaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-07-03 06:13:30 +0200
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-07-03 10:51:56 +0200
commit623d1a1af77bd52a389c6eda5920e28eb2ee468b (patch)
tree85d0a7fbcd83b5a2cacf50b24a66c0063f7eca07 /net/ipv6/af_inet6.c
parentipv6 route: Prefer outgoing interface with source address assigned. (diff)
downloadlinux-623d1a1af77bd52a389c6eda5920e28eb2ee468b.tar.xz
linux-623d1a1af77bd52a389c6eda5920e28eb2ee468b.zip
ipv6: Do cleanup for ip6_mr_init.
If do not do it, we will get following issues: 1. Leaving junks after inet6_init failing halfway. 2. Leaving proc and notifier junks after ipv6 modules unloading. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 3ce8d2f318c6..6b39af1acb5e 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -953,7 +953,9 @@ static int __init inet6_init(void)
if (err)
goto icmp_fail;
#ifdef CONFIG_IPV6_MROUTE
- ip6_mr_init();
+ err = ip6_mr_init();
+ if (err)
+ goto ipmr_fail;
#endif
err = ndisc_init();
if (err)
@@ -1057,6 +1059,10 @@ netfilter_fail:
igmp_fail:
ndisc_cleanup();
ndisc_fail:
+#ifdef CONFIG_IPV6_MROUTE
+ ip6_mr_cleanup();
+ipmr_fail:
+#endif
icmpv6_cleanup();
icmp_fail:
unregister_pernet_subsys(&inet6_net_ops);
@@ -1111,6 +1117,9 @@ static void __exit inet6_exit(void)
ipv6_netfilter_fini();
igmp6_cleanup();
ndisc_cleanup();
+#ifdef CONFIG_IPV6_MROUTE
+ ip6_mr_cleanup();
+#endif
icmpv6_cleanup();
rawv6_exit();