aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/af_inet6.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 60b8a225404..af5b3078766 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -934,12 +934,6 @@ static int __init inet6_init(void)
934 err = register_pernet_subsys(&inet6_net_ops); 934 err = register_pernet_subsys(&inet6_net_ops);
935 if (err) 935 if (err)
936 goto register_pernet_fail; 936 goto register_pernet_fail;
937
938#ifdef CONFIG_SYSCTL
939 err = ipv6_sysctl_register();
940 if (err)
941 goto sysctl_fail;
942#endif
943 err = icmpv6_init(); 937 err = icmpv6_init();
944 if (err) 938 if (err)
945 goto icmp_fail; 939 goto icmp_fail;
@@ -1006,9 +1000,19 @@ static int __init inet6_init(void)
1006 err = ipv6_packet_init(); 1000 err = ipv6_packet_init();
1007 if (err) 1001 if (err)
1008 goto ipv6_packet_fail; 1002 goto ipv6_packet_fail;
1003
1004#ifdef CONFIG_SYSCTL
1005 err = ipv6_sysctl_register();
1006 if (err)
1007 goto sysctl_fail;
1008#endif
1009out: 1009out:
1010 return err; 1010 return err;
1011 1011
1012#ifdef CONFIG_SYSCTL
1013sysctl_fail:
1014 ipv6_packet_cleanup();
1015#endif
1012ipv6_packet_fail: 1016ipv6_packet_fail:
1013 tcpv6_exit(); 1017 tcpv6_exit();
1014tcpv6_fail: 1018tcpv6_fail:
@@ -1050,10 +1054,6 @@ igmp_fail:
1050ndisc_fail: 1054ndisc_fail:
1051 icmpv6_cleanup(); 1055 icmpv6_cleanup();
1052icmp_fail: 1056icmp_fail:
1053#ifdef CONFIG_SYSCTL
1054 ipv6_sysctl_unregister();
1055sysctl_fail:
1056#endif
1057 unregister_pernet_subsys(&inet6_net_ops); 1057 unregister_pernet_subsys(&inet6_net_ops);
1058register_pernet_fail: 1058register_pernet_fail:
1059 cleanup_ipv6_mibs(); 1059 cleanup_ipv6_mibs();
@@ -1083,6 +1083,9 @@ static void __exit inet6_exit(void)
1083 /* Disallow any further netlink messages */ 1083 /* Disallow any further netlink messages */
1084 rtnl_unregister_all(PF_INET6); 1084 rtnl_unregister_all(PF_INET6);
1085 1085
1086#ifdef CONFIG_SYSCTL
1087 ipv6_sysctl_unregister();
1088#endif
1086 udpv6_exit(); 1089 udpv6_exit();
1087#ifdef CONFIG_IP_UDPLITE 1090#ifdef CONFIG_IP_UDPLITE
1088 udplitev6_exit(); 1091 udplitev6_exit();
@@ -1112,9 +1115,7 @@ static void __exit inet6_exit(void)
1112 ndisc_cleanup(); 1115 ndisc_cleanup();
1113 icmpv6_cleanup(); 1116 icmpv6_cleanup();
1114 rawv6_exit(); 1117 rawv6_exit();
1115#ifdef CONFIG_SYSCTL 1118
1116 ipv6_sysctl_unregister();
1117#endif
1118 unregister_pernet_subsys(&inet6_net_ops); 1119 unregister_pernet_subsys(&inet6_net_ops);
1119 cleanup_ipv6_mibs(); 1120 cleanup_ipv6_mibs();
1120 proto_unregister(&rawv6_prot); 1121 proto_unregister(&rawv6_prot);