aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap
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 /drivers/net/wireless/hostap
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 'drivers/net/wireless/hostap')
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 446de51bab74..9a470e80ca24 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -24,6 +24,7 @@
24#include <linux/rtnetlink.h> 24#include <linux/rtnetlink.h>
25#include <linux/wireless.h> 25#include <linux/wireless.h>
26#include <linux/etherdevice.h> 26#include <linux/etherdevice.h>
27#include <net/net_namespace.h>
27#include <net/iw_handler.h> 28#include <net/iw_handler.h>
28#include <net/ieee80211.h> 29#include <net/ieee80211.h>
29#include <net/ieee80211_crypt.h> 30#include <net/ieee80211_crypt.h>
@@ -1093,8 +1094,8 @@ struct proc_dir_entry *hostap_proc;
1093 1094
1094static int __init hostap_init(void) 1095static int __init hostap_init(void)
1095{ 1096{
1096 if (proc_net != NULL) { 1097 if (init_net.proc_net != NULL) {
1097 hostap_proc = proc_mkdir("hostap", proc_net); 1098 hostap_proc = proc_mkdir("hostap", init_net.proc_net);
1098 if (!hostap_proc) 1099 if (!hostap_proc)
1099 printk(KERN_WARNING "Failed to mkdir " 1100 printk(KERN_WARNING "Failed to mkdir "
1100 "/proc/net/hostap\n"); 1101 "/proc/net/hostap\n");
@@ -1109,7 +1110,7 @@ static void __exit hostap_exit(void)
1109{ 1110{
1110 if (hostap_proc != NULL) { 1111 if (hostap_proc != NULL) {
1111 hostap_proc = NULL; 1112 hostap_proc = NULL;
1112 remove_proc_entry("hostap", proc_net); 1113 remove_proc_entry("hostap", init_net.proc_net);
1113 } 1114 }
1114} 1115}
1115 1116