aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/proc.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-10-07 17:46:18 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-07 17:46:18 -0400
commit06f38527decedbea0588256ecbb5784d4bb35b81 (patch)
treeb8efd6b4df3327a3daaeb6647eecbdd526d3a6dd /net/ipv6/proc.c
parent835bcc0497e18f54153ac9e32b598dd8ffb7aa66 (diff)
netns: register /proc/net/dev_snmp6/* in each ns
Do the same for /proc/net/snmp6. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r--net/ipv6/proc.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 16ebf85d4ad2..57640620c165 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -247,12 +247,27 @@ static int ipv6_proc_init_net(struct net *net)
247 if (!proc_net_fops_create(net, "sockstat6", S_IRUGO, 247 if (!proc_net_fops_create(net, "sockstat6", S_IRUGO,
248 &sockstat6_seq_fops)) 248 &sockstat6_seq_fops))
249 return -ENOMEM; 249 return -ENOMEM;
250
251 if (!proc_net_fops_create(net, "snmp6", S_IRUGO, &snmp6_seq_fops))
252 goto proc_snmp6_fail;
253
254 net->mib.proc_net_devsnmp6 = proc_mkdir("dev_snmp6", net->proc_net);
255 if (!net->mib.proc_net_devsnmp6)
256 goto proc_dev_snmp6_fail;
250 return 0; 257 return 0;
258
259proc_snmp6_fail:
260 proc_net_remove(net, "sockstat6");
261proc_dev_snmp6_fail:
262 proc_net_remove(net, "dev_snmp6");
263 return -ENOMEM;
251} 264}
252 265
253static void ipv6_proc_exit_net(struct net *net) 266static void ipv6_proc_exit_net(struct net *net)
254{ 267{
255 proc_net_remove(net, "sockstat6"); 268 proc_net_remove(net, "sockstat6");
269 proc_net_remove(net, "dev_snmp6");
270 proc_net_remove(net, "snmp6");
256} 271}
257 272
258static struct pernet_operations ipv6_proc_ops = { 273static struct pernet_operations ipv6_proc_ops = {
@@ -262,34 +277,11 @@ static struct pernet_operations ipv6_proc_ops = {
262 277
263int __init ipv6_misc_proc_init(void) 278int __init ipv6_misc_proc_init(void)
264{ 279{
265 int rc = 0; 280 return register_pernet_subsys(&ipv6_proc_ops);
266
267 if (register_pernet_subsys(&ipv6_proc_ops))
268 goto proc_net_fail;
269
270 if (!proc_net_fops_create(&init_net, "snmp6", S_IRUGO, &snmp6_seq_fops))
271 goto proc_snmp6_fail;
272
273 init_net.mib.proc_net_devsnmp6 =
274 proc_mkdir("dev_snmp6", init_net.proc_net);
275 if (!init_net.mib.proc_net_devsnmp6)
276 goto proc_dev_snmp6_fail;
277out:
278 return rc;
279
280proc_dev_snmp6_fail:
281 proc_net_remove(&init_net, "snmp6");
282proc_snmp6_fail:
283 unregister_pernet_subsys(&ipv6_proc_ops);
284proc_net_fail:
285 rc = -ENOMEM;
286 goto out;
287} 281}
288 282
289void ipv6_misc_proc_exit(void) 283void ipv6_misc_proc_exit(void)
290{ 284{
291 proc_net_remove(&init_net, "dev_snmp6");
292 proc_net_remove(&init_net, "snmp6");
293 unregister_pernet_subsys(&ipv6_proc_ops); 285 unregister_pernet_subsys(&ipv6_proc_ops);
294} 286}
295 287