aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_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/decnet/dn_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/decnet/dn_route.c')
-rw-r--r--net/decnet/dn_route.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index a4a620971ef0..4cfea9563d2a 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -77,6 +77,7 @@
77#include <linux/rcupdate.h> 77#include <linux/rcupdate.h>
78#include <linux/times.h> 78#include <linux/times.h>
79#include <asm/errno.h> 79#include <asm/errno.h>
80#include <net/net_namespace.h>
80#include <net/netlink.h> 81#include <net/netlink.h>
81#include <net/neighbour.h> 82#include <net/neighbour.h>
82#include <net/dst.h> 83#include <net/dst.h>
@@ -1814,7 +1815,7 @@ void __init dn_route_init(void)
1814 1815
1815 dn_dst_ops.gc_thresh = (dn_rt_hash_mask + 1); 1816 dn_dst_ops.gc_thresh = (dn_rt_hash_mask + 1);
1816 1817
1817 proc_net_fops_create("decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops); 1818 proc_net_fops_create(&init_net, "decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops);
1818 1819
1819#ifdef CONFIG_DECNET_ROUTER 1820#ifdef CONFIG_DECNET_ROUTER
1820 rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump); 1821 rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump);
@@ -1829,6 +1830,6 @@ void __exit dn_route_cleanup(void)
1829 del_timer(&dn_route_timer); 1830 del_timer(&dn_route_timer);
1830 dn_run_flush(0); 1831 dn_run_flush(0);
1831 1832
1832 proc_net_remove("decnet_cache"); 1833 proc_net_remove(&init_net, "decnet_cache");
1833} 1834}
1834 1835