aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.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/mcast.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/mcast.c')
-rw-r--r--net/ipv6/mcast.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index ae9881832a7e..a41d5a0b50cc 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -49,6 +49,7 @@
49#include <linux/netfilter.h> 49#include <linux/netfilter.h>
50#include <linux/netfilter_ipv6.h> 50#include <linux/netfilter_ipv6.h>
51 51
52#include <net/net_namespace.h>
52#include <net/sock.h> 53#include <net/sock.h>
53#include <net/snmp.h> 54#include <net/snmp.h>
54 55
@@ -2658,8 +2659,8 @@ int __init igmp6_init(struct net_proto_family *ops)
2658 np->hop_limit = 1; 2659 np->hop_limit = 1;
2659 2660
2660#ifdef CONFIG_PROC_FS 2661#ifdef CONFIG_PROC_FS
2661 proc_net_fops_create("igmp6", S_IRUGO, &igmp6_mc_seq_fops); 2662 proc_net_fops_create(&init_net, "igmp6", S_IRUGO, &igmp6_mc_seq_fops);
2662 proc_net_fops_create("mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops); 2663 proc_net_fops_create(&init_net, "mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops);
2663#endif 2664#endif
2664 2665
2665 return 0; 2666 return 0;
@@ -2671,7 +2672,7 @@ void igmp6_cleanup(void)
2671 igmp6_socket = NULL; /* for safety */ 2672 igmp6_socket = NULL; /* for safety */
2672 2673
2673#ifdef CONFIG_PROC_FS 2674#ifdef CONFIG_PROC_FS
2674 proc_net_remove("mcfilter6"); 2675 proc_net_remove(&init_net, "mcfilter6");
2675 proc_net_remove("igmp6"); 2676 proc_net_remove(&init_net, "igmp6");
2676#endif 2677#endif
2677} 2678}