aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-09-12 06:01:34 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:06 -0400
commit457c4cbc5a3dde259d2a1f15d5f9785290397267 (patch)
treea2ceee88780cbce27433b9a4434b3e9251efd81a /net/ipv6/route.c
parent07feaebfcc10cd35e745c7073667935246494bee (diff)
[NET]: Make /proc/net per network namespace
This patch makes /proc/net per network namespace. It modifies the global variables proc_net and proc_net_stat to be per network namespace. The proc_net file helpers are modified to take a network namespace argument, and all of their callers are fixed to pass &init_net for that argument. This ensures that all of the /proc/net files are only visible and usable in the initial network namespace until the code behind them has been updated to be handle multiple network namespaces. Making /proc/net per namespace is necessary as at least some files in /proc/net depend upon the set of network devices which is per network namespace, and even more files in /proc/net have contents that are relevant to a single network namespace. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 55ea80fac601..f4f0c341e5c8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -44,6 +44,7 @@
44#include <linux/seq_file.h> 44#include <linux/seq_file.h>
45#endif 45#endif
46 46
47#include <net/net_namespace.h>
47#include <net/snmp.h> 48#include <net/snmp.h>
48#include <net/ipv6.h> 49#include <net/ipv6.h>
49#include <net/ip6_fib.h> 50#include <net/ip6_fib.h>
@@ -2561,11 +2562,11 @@ void __init ip6_route_init(void)
2561 2562
2562 fib6_init(); 2563 fib6_init();
2563#ifdef CONFIG_PROC_FS 2564#ifdef CONFIG_PROC_FS
2564 p = proc_net_create("ipv6_route", 0, rt6_proc_info); 2565 p = proc_net_create(&init_net, "ipv6_route", 0, rt6_proc_info);
2565 if (p) 2566 if (p)
2566 p->owner = THIS_MODULE; 2567 p->owner = THIS_MODULE;
2567 2568
2568 proc_net_fops_create("rt6_stats", S_IRUGO, &rt6_stats_seq_fops); 2569 proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
2569#endif 2570#endif
2570#ifdef CONFIG_XFRM 2571#ifdef CONFIG_XFRM
2571 xfrm6_init(); 2572 xfrm6_init();
@@ -2585,8 +2586,8 @@ void ip6_route_cleanup(void)
2585 fib6_rules_cleanup(); 2586 fib6_rules_cleanup();
2586#endif 2587#endif
2587#ifdef CONFIG_PROC_FS 2588#ifdef CONFIG_PROC_FS
2588 proc_net_remove("ipv6_route"); 2589 proc_net_remove(&init_net, "ipv6_route");
2589 proc_net_remove("rt6_stats"); 2590 proc_net_remove(&init_net, "rt6_stats");
2590#endif 2591#endif
2591#ifdef CONFIG_XFRM 2592#ifdef CONFIG_XFRM
2592 xfrm6_fini(); 2593 xfrm6_fini();