diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-07-03 00:13:30 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-03 04:51:56 -0400 |
commit | 623d1a1af77bd52a389c6eda5920e28eb2ee468b (patch) | |
tree | 85d0a7fbcd83b5a2cacf50b24a66c0063f7eca07 /net/ipv6/af_inet6.c | |
parent | dd3abc4ef52597ec8268274222574b2700ba3ded (diff) |
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.c | 11 |
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) | |||
953 | if (err) | 953 | if (err) |
954 | goto icmp_fail; | 954 | goto icmp_fail; |
955 | #ifdef CONFIG_IPV6_MROUTE | 955 | #ifdef CONFIG_IPV6_MROUTE |
956 | ip6_mr_init(); | 956 | err = ip6_mr_init(); |
957 | if (err) | ||
958 | goto ipmr_fail; | ||
957 | #endif | 959 | #endif |
958 | err = ndisc_init(); | 960 | err = ndisc_init(); |
959 | if (err) | 961 | if (err) |
@@ -1057,6 +1059,10 @@ netfilter_fail: | |||
1057 | igmp_fail: | 1059 | igmp_fail: |
1058 | ndisc_cleanup(); | 1060 | ndisc_cleanup(); |
1059 | ndisc_fail: | 1061 | ndisc_fail: |
1062 | #ifdef CONFIG_IPV6_MROUTE | ||
1063 | ip6_mr_cleanup(); | ||
1064 | ipmr_fail: | ||
1065 | #endif | ||
1060 | icmpv6_cleanup(); | 1066 | icmpv6_cleanup(); |
1061 | icmp_fail: | 1067 | icmp_fail: |
1062 | unregister_pernet_subsys(&inet6_net_ops); | 1068 | unregister_pernet_subsys(&inet6_net_ops); |
@@ -1111,6 +1117,9 @@ static void __exit inet6_exit(void) | |||
1111 | ipv6_netfilter_fini(); | 1117 | ipv6_netfilter_fini(); |
1112 | igmp6_cleanup(); | 1118 | igmp6_cleanup(); |
1113 | ndisc_cleanup(); | 1119 | ndisc_cleanup(); |
1120 | #ifdef CONFIG_IPV6_MROUTE | ||
1121 | ip6_mr_cleanup(); | ||
1122 | #endif | ||
1114 | icmpv6_cleanup(); | 1123 | icmpv6_cleanup(); |
1115 | rawv6_exit(); | 1124 | rawv6_exit(); |
1116 | 1125 | ||