aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/sysctl_net_ipv6.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index f713fbf34c23..7329decf1f9d 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -91,10 +91,10 @@ EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);
91 91
92static struct ctl_table_header *ipv6_sysctl_header; 92static struct ctl_table_header *ipv6_sysctl_header;
93 93
94int ipv6_sysctl_register(void) 94static int ipv6_sysctl_net_init(struct net *net)
95{ 95{
96 ipv6_sysctl_header = register_sysctl_paths(net_ipv6_ctl_path, 96 ipv6_sysctl_header = register_net_sysctl_table(net, net_ipv6_ctl_path,
97 ipv6_table); 97 ipv6_table);
98 if (!ipv6_sysctl_header) 98 if (!ipv6_sysctl_header)
99 return -ENOMEM; 99 return -ENOMEM;
100 100
@@ -102,7 +102,22 @@ int ipv6_sysctl_register(void)
102 102
103} 103}
104 104
105static void ipv6_sysctl_net_exit(struct net *net)
106{
107 unregister_net_sysctl_table(ipv6_sysctl_header);
108}
109
110static struct pernet_operations ipv6_sysctl_net_ops = {
111 .init = ipv6_sysctl_net_init,
112 .exit = ipv6_sysctl_net_exit,
113};
114
115int ipv6_sysctl_register(void)
116{
117 return register_pernet_subsys(&ipv6_sysctl_net_ops);
118}
119
105void ipv6_sysctl_unregister(void) 120void ipv6_sysctl_unregister(void)
106{ 121{
107 unregister_sysctl_table(ipv6_sysctl_header); 122 unregister_pernet_subsys(&ipv6_sysctl_net_ops);
108} 123}