diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2007-09-12 06:01:34 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:06 -0400 |
commit | 457c4cbc5a3dde259d2a1f15d5f9785290397267 (patch) | |
tree | a2ceee88780cbce27433b9a4434b3e9251efd81a /drivers | |
parent | 07feaebfcc10cd35e745c7073667935246494bee (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')
-rw-r--r-- | drivers/isdn/divert/divert_procfs.c | 7 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/diva_didd.c | 5 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_procconf.c | 5 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 7 | ||||
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 5 | ||||
-rw-r--r-- | drivers/net/hamradio/scc.c | 5 | ||||
-rw-r--r-- | drivers/net/hamradio/yam.c | 5 | ||||
-rw-r--r-- | drivers/net/ibmveth.c | 7 | ||||
-rw-r--r-- | drivers/net/pppoe.c | 5 | ||||
-rw-r--r-- | drivers/net/pppol2tp.c | 5 | ||||
-rw-r--r-- | drivers/net/tokenring/lanstreamer.c | 5 | ||||
-rw-r--r-- | drivers/net/tokenring/olympic.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/strip.c | 5 |
14 files changed, 48 insertions, 34 deletions
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 559a0d0244cf..4fd4c46892e3 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #endif | 18 | #endif |
19 | #include <linux/isdnif.h> | 19 | #include <linux/isdnif.h> |
20 | #include <net/net_namespace.h> | ||
20 | #include "isdn_divert.h" | 21 | #include "isdn_divert.h" |
21 | 22 | ||
22 | 23 | ||
@@ -284,12 +285,12 @@ divert_dev_init(void) | |||
284 | init_waitqueue_head(&rd_queue); | 285 | init_waitqueue_head(&rd_queue); |
285 | 286 | ||
286 | #ifdef CONFIG_PROC_FS | 287 | #ifdef CONFIG_PROC_FS |
287 | isdn_proc_entry = proc_mkdir("net/isdn", NULL); | 288 | isdn_proc_entry = proc_mkdir("isdn", init_net.proc_net); |
288 | if (!isdn_proc_entry) | 289 | if (!isdn_proc_entry) |
289 | return (-1); | 290 | return (-1); |
290 | isdn_divert_entry = create_proc_entry("divert", S_IFREG | S_IRUGO, isdn_proc_entry); | 291 | isdn_divert_entry = create_proc_entry("divert", S_IFREG | S_IRUGO, isdn_proc_entry); |
291 | if (!isdn_divert_entry) { | 292 | if (!isdn_divert_entry) { |
292 | remove_proc_entry("net/isdn", NULL); | 293 | remove_proc_entry("isdn", init_net.proc_net); |
293 | return (-1); | 294 | return (-1); |
294 | } | 295 | } |
295 | isdn_divert_entry->proc_fops = &isdn_fops; | 296 | isdn_divert_entry->proc_fops = &isdn_fops; |
@@ -309,7 +310,7 @@ divert_dev_deinit(void) | |||
309 | 310 | ||
310 | #ifdef CONFIG_PROC_FS | 311 | #ifdef CONFIG_PROC_FS |
311 | remove_proc_entry("divert", isdn_proc_entry); | 312 | remove_proc_entry("divert", isdn_proc_entry); |
312 | remove_proc_entry("net/isdn", NULL); | 313 | remove_proc_entry("isdn", init_net.proc_net); |
313 | #endif /* CONFIG_PROC_FS */ | 314 | #endif /* CONFIG_PROC_FS */ |
314 | 315 | ||
315 | return (0); | 316 | return (0); |
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c index d755d904e62c..993b14cf1778 100644 --- a/drivers/isdn/hardware/eicon/diva_didd.c +++ b/drivers/isdn/hardware/eicon/diva_didd.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
18 | #include <net/net_namespace.h> | ||
18 | 19 | ||
19 | #include "platform.h" | 20 | #include "platform.h" |
20 | #include "di_defs.h" | 21 | #include "di_defs.h" |
@@ -86,7 +87,7 @@ proc_read(char *page, char **start, off_t off, int count, int *eof, | |||
86 | 87 | ||
87 | static int DIVA_INIT_FUNCTION create_proc(void) | 88 | static int DIVA_INIT_FUNCTION create_proc(void) |
88 | { | 89 | { |
89 | proc_net_eicon = proc_mkdir("net/eicon", NULL); | 90 | proc_net_eicon = proc_mkdir("eicon", init_net.proc_net); |
90 | 91 | ||
91 | if (proc_net_eicon) { | 92 | if (proc_net_eicon) { |
92 | if ((proc_didd = | 93 | if ((proc_didd = |
@@ -102,7 +103,7 @@ static int DIVA_INIT_FUNCTION create_proc(void) | |||
102 | static void remove_proc(void) | 103 | static void remove_proc(void) |
103 | { | 104 | { |
104 | remove_proc_entry(DRIVERLNAME, proc_net_eicon); | 105 | remove_proc_entry(DRIVERLNAME, proc_net_eicon); |
105 | remove_proc_entry("net/eicon", NULL); | 106 | remove_proc_entry("eicon", init_net.proc_net); |
106 | } | 107 | } |
107 | 108 | ||
108 | static int DIVA_INIT_FUNCTION divadidd_init(void) | 109 | static int DIVA_INIT_FUNCTION divadidd_init(void) |
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index dc477e0aab0e..27d890b48f88 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/proc_fs.h> | 16 | #include <linux/proc_fs.h> |
17 | #include <linux/pci.h> | 17 | #include <linux/pci.h> |
18 | #include <linux/smp_lock.h> | 18 | #include <linux/smp_lock.h> |
19 | #include <net/net_namespace.h> | ||
19 | 20 | ||
20 | #include "hysdn_defs.h" | 21 | #include "hysdn_defs.h" |
21 | 22 | ||
@@ -392,7 +393,7 @@ hysdn_procconf_init(void) | |||
392 | hysdn_card *card; | 393 | hysdn_card *card; |
393 | unsigned char conf_name[20]; | 394 | unsigned char conf_name[20]; |
394 | 395 | ||
395 | hysdn_proc_entry = proc_mkdir(PROC_SUBDIR_NAME, proc_net); | 396 | hysdn_proc_entry = proc_mkdir(PROC_SUBDIR_NAME, init_net.proc_net); |
396 | if (!hysdn_proc_entry) { | 397 | if (!hysdn_proc_entry) { |
397 | printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n"); | 398 | printk(KERN_ERR "HYSDN: unable to create hysdn subdir\n"); |
398 | return (-1); | 399 | return (-1); |
@@ -437,5 +438,5 @@ hysdn_procconf_release(void) | |||
437 | card = card->next; /* point to next card */ | 438 | card = card->next; /* point to next card */ |
438 | } | 439 | } |
439 | 440 | ||
440 | remove_proc_entry(PROC_SUBDIR_NAME, proc_net); | 441 | remove_proc_entry(PROC_SUBDIR_NAME, init_net.proc_net); |
441 | } | 442 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 1afda3230def..5de648f90a45 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #include <linux/if_vlan.h> | 75 | #include <linux/if_vlan.h> |
76 | #include <linux/if_bonding.h> | 76 | #include <linux/if_bonding.h> |
77 | #include <net/route.h> | 77 | #include <net/route.h> |
78 | #include <net/net_namespace.h> | ||
78 | #include "bonding.h" | 79 | #include "bonding.h" |
79 | #include "bond_3ad.h" | 80 | #include "bond_3ad.h" |
80 | #include "bond_alb.h" | 81 | #include "bond_alb.h" |
@@ -3144,7 +3145,7 @@ static void bond_create_proc_dir(void) | |||
3144 | { | 3145 | { |
3145 | int len = strlen(DRV_NAME); | 3146 | int len = strlen(DRV_NAME); |
3146 | 3147 | ||
3147 | for (bond_proc_dir = proc_net->subdir; bond_proc_dir; | 3148 | for (bond_proc_dir = init_net.proc_net->subdir; bond_proc_dir; |
3148 | bond_proc_dir = bond_proc_dir->next) { | 3149 | bond_proc_dir = bond_proc_dir->next) { |
3149 | if ((bond_proc_dir->namelen == len) && | 3150 | if ((bond_proc_dir->namelen == len) && |
3150 | !memcmp(bond_proc_dir->name, DRV_NAME, len)) { | 3151 | !memcmp(bond_proc_dir->name, DRV_NAME, len)) { |
@@ -3153,7 +3154,7 @@ static void bond_create_proc_dir(void) | |||
3153 | } | 3154 | } |
3154 | 3155 | ||
3155 | if (!bond_proc_dir) { | 3156 | if (!bond_proc_dir) { |
3156 | bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); | 3157 | bond_proc_dir = proc_mkdir(DRV_NAME, init_net.proc_net); |
3157 | if (bond_proc_dir) { | 3158 | if (bond_proc_dir) { |
3158 | bond_proc_dir->owner = THIS_MODULE; | 3159 | bond_proc_dir->owner = THIS_MODULE; |
3159 | } else { | 3160 | } else { |
@@ -3188,7 +3189,7 @@ static void bond_destroy_proc_dir(void) | |||
3188 | bond_proc_dir->owner = NULL; | 3189 | bond_proc_dir->owner = NULL; |
3189 | } | 3190 | } |
3190 | } else { | 3191 | } else { |
3191 | remove_proc_entry(DRV_NAME, proc_net); | 3192 | remove_proc_entry(DRV_NAME, init_net.proc_net); |
3192 | bond_proc_dir = NULL; | 3193 | bond_proc_dir = NULL; |
3193 | } | 3194 | } |
3194 | } | 3195 | } |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index cc0ee93669ea..1699d42d13ca 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -83,6 +83,7 @@ | |||
83 | 83 | ||
84 | #include <net/ip.h> | 84 | #include <net/ip.h> |
85 | #include <net/arp.h> | 85 | #include <net/arp.h> |
86 | #include <net/net_namespace.h> | ||
86 | 87 | ||
87 | #include <linux/bpqether.h> | 88 | #include <linux/bpqether.h> |
88 | 89 | ||
@@ -594,7 +595,7 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi | |||
594 | static int __init bpq_init_driver(void) | 595 | static int __init bpq_init_driver(void) |
595 | { | 596 | { |
596 | #ifdef CONFIG_PROC_FS | 597 | #ifdef CONFIG_PROC_FS |
597 | if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) { | 598 | if (!proc_net_fops_create(&init_net, "bpqether", S_IRUGO, &bpq_info_fops)) { |
598 | printk(KERN_ERR | 599 | printk(KERN_ERR |
599 | "bpq: cannot create /proc/net/bpqether entry.\n"); | 600 | "bpq: cannot create /proc/net/bpqether entry.\n"); |
600 | return -ENOENT; | 601 | return -ENOENT; |
@@ -618,7 +619,7 @@ static void __exit bpq_cleanup_driver(void) | |||
618 | 619 | ||
619 | unregister_netdevice_notifier(&bpq_dev_notifier); | 620 | unregister_netdevice_notifier(&bpq_dev_notifier); |
620 | 621 | ||
621 | proc_net_remove("bpqether"); | 622 | proc_net_remove(&init_net, "bpqether"); |
622 | 623 | ||
623 | rtnl_lock(); | 624 | rtnl_lock(); |
624 | while (!list_empty(&bpq_devices)) { | 625 | while (!list_empty(&bpq_devices)) { |
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index 6fdaad5a4577..39b3b82aa4a4 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c | |||
@@ -174,6 +174,7 @@ | |||
174 | #include <linux/seq_file.h> | 174 | #include <linux/seq_file.h> |
175 | #include <linux/bitops.h> | 175 | #include <linux/bitops.h> |
176 | 176 | ||
177 | #include <net/net_namespace.h> | ||
177 | #include <net/ax25.h> | 178 | #include <net/ax25.h> |
178 | 179 | ||
179 | #include <asm/irq.h> | 180 | #include <asm/irq.h> |
@@ -2114,7 +2115,7 @@ static int __init scc_init_driver (void) | |||
2114 | } | 2115 | } |
2115 | rtnl_unlock(); | 2116 | rtnl_unlock(); |
2116 | 2117 | ||
2117 | proc_net_fops_create("z8530drv", 0, &scc_net_seq_fops); | 2118 | proc_net_fops_create(&init_net, "z8530drv", 0, &scc_net_seq_fops); |
2118 | 2119 | ||
2119 | return 0; | 2120 | return 0; |
2120 | } | 2121 | } |
@@ -2169,7 +2170,7 @@ static void __exit scc_cleanup_driver(void) | |||
2169 | if (Vector_Latch) | 2170 | if (Vector_Latch) |
2170 | release_region(Vector_Latch, 1); | 2171 | release_region(Vector_Latch, 1); |
2171 | 2172 | ||
2172 | proc_net_remove("z8530drv"); | 2173 | proc_net_remove(&init_net, "z8530drv"); |
2173 | } | 2174 | } |
2174 | 2175 | ||
2175 | MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>"); | 2176 | MODULE_AUTHOR("Joerg Reuter <jreuter@yaina.de>"); |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 467559debfd6..401724ddafcd 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -65,6 +65,7 @@ | |||
65 | #include <linux/kernel.h> | 65 | #include <linux/kernel.h> |
66 | #include <linux/proc_fs.h> | 66 | #include <linux/proc_fs.h> |
67 | #include <linux/seq_file.h> | 67 | #include <linux/seq_file.h> |
68 | #include <net/net_namespace.h> | ||
68 | 69 | ||
69 | #include <asm/uaccess.h> | 70 | #include <asm/uaccess.h> |
70 | #include <linux/init.h> | 71 | #include <linux/init.h> |
@@ -1142,7 +1143,7 @@ static int __init yam_init_driver(void) | |||
1142 | yam_timer.expires = jiffies + HZ / 100; | 1143 | yam_timer.expires = jiffies + HZ / 100; |
1143 | add_timer(&yam_timer); | 1144 | add_timer(&yam_timer); |
1144 | 1145 | ||
1145 | proc_net_fops_create("yam", S_IRUGO, &yam_info_fops); | 1146 | proc_net_fops_create(&init_net, "yam", S_IRUGO, &yam_info_fops); |
1146 | return 0; | 1147 | return 0; |
1147 | error: | 1148 | error: |
1148 | while (--i >= 0) { | 1149 | while (--i >= 0) { |
@@ -1174,7 +1175,7 @@ static void __exit yam_cleanup_driver(void) | |||
1174 | kfree(p); | 1175 | kfree(p); |
1175 | } | 1176 | } |
1176 | 1177 | ||
1177 | proc_net_remove("yam"); | 1178 | proc_net_remove(&init_net, "yam"); |
1178 | } | 1179 | } |
1179 | 1180 | ||
1180 | /* --------------------------------------------------------------------- */ | 1181 | /* --------------------------------------------------------------------- */ |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 78e28ada1e21..0c35d72f5f8d 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/mm.h> | 47 | #include <linux/mm.h> |
48 | #include <linux/ethtool.h> | 48 | #include <linux/ethtool.h> |
49 | #include <linux/proc_fs.h> | 49 | #include <linux/proc_fs.h> |
50 | #include <net/net_namespace.h> | ||
50 | #include <asm/semaphore.h> | 51 | #include <asm/semaphore.h> |
51 | #include <asm/hvcall.h> | 52 | #include <asm/hvcall.h> |
52 | #include <asm/atomic.h> | 53 | #include <asm/atomic.h> |
@@ -97,7 +98,7 @@ static void ibmveth_rxq_harvest_buffer(struct ibmveth_adapter *adapter); | |||
97 | static struct kobj_type ktype_veth_pool; | 98 | static struct kobj_type ktype_veth_pool; |
98 | 99 | ||
99 | #ifdef CONFIG_PROC_FS | 100 | #ifdef CONFIG_PROC_FS |
100 | #define IBMVETH_PROC_DIR "net/ibmveth" | 101 | #define IBMVETH_PROC_DIR "ibmveth" |
101 | static struct proc_dir_entry *ibmveth_proc_dir; | 102 | static struct proc_dir_entry *ibmveth_proc_dir; |
102 | #endif | 103 | #endif |
103 | 104 | ||
@@ -1091,7 +1092,7 @@ static int __devexit ibmveth_remove(struct vio_dev *dev) | |||
1091 | #ifdef CONFIG_PROC_FS | 1092 | #ifdef CONFIG_PROC_FS |
1092 | static void ibmveth_proc_register_driver(void) | 1093 | static void ibmveth_proc_register_driver(void) |
1093 | { | 1094 | { |
1094 | ibmveth_proc_dir = proc_mkdir(IBMVETH_PROC_DIR, NULL); | 1095 | ibmveth_proc_dir = proc_mkdir(IBMVETH_PROC_DIR, init_net.proc_net); |
1095 | if (ibmveth_proc_dir) { | 1096 | if (ibmveth_proc_dir) { |
1096 | SET_MODULE_OWNER(ibmveth_proc_dir); | 1097 | SET_MODULE_OWNER(ibmveth_proc_dir); |
1097 | } | 1098 | } |
@@ -1099,7 +1100,7 @@ static void ibmveth_proc_register_driver(void) | |||
1099 | 1100 | ||
1100 | static void ibmveth_proc_unregister_driver(void) | 1101 | static void ibmveth_proc_unregister_driver(void) |
1101 | { | 1102 | { |
1102 | remove_proc_entry(IBMVETH_PROC_DIR, NULL); | 1103 | remove_proc_entry(IBMVETH_PROC_DIR, init_net.proc_net); |
1103 | } | 1104 | } |
1104 | 1105 | ||
1105 | static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos) | 1106 | static void *ibmveth_seq_start(struct seq_file *seq, loff_t *pos) |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 9b30cd600a64..ee8ce195c538 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -78,6 +78,7 @@ | |||
78 | #include <linux/proc_fs.h> | 78 | #include <linux/proc_fs.h> |
79 | #include <linux/seq_file.h> | 79 | #include <linux/seq_file.h> |
80 | 80 | ||
81 | #include <net/net_namespace.h> | ||
81 | #include <net/sock.h> | 82 | #include <net/sock.h> |
82 | 83 | ||
83 | #include <asm/uaccess.h> | 84 | #include <asm/uaccess.h> |
@@ -1042,7 +1043,7 @@ static int __init pppoe_proc_init(void) | |||
1042 | { | 1043 | { |
1043 | struct proc_dir_entry *p; | 1044 | struct proc_dir_entry *p; |
1044 | 1045 | ||
1045 | p = create_proc_entry("net/pppoe", S_IRUGO, NULL); | 1046 | p = create_proc_entry("pppoe", S_IRUGO, init_net.proc_net); |
1046 | if (!p) | 1047 | if (!p) |
1047 | return -ENOMEM; | 1048 | return -ENOMEM; |
1048 | 1049 | ||
@@ -1113,7 +1114,7 @@ static void __exit pppoe_exit(void) | |||
1113 | dev_remove_pack(&pppoes_ptype); | 1114 | dev_remove_pack(&pppoes_ptype); |
1114 | dev_remove_pack(&pppoed_ptype); | 1115 | dev_remove_pack(&pppoed_ptype); |
1115 | unregister_netdevice_notifier(&pppoe_notifier); | 1116 | unregister_netdevice_notifier(&pppoe_notifier); |
1116 | remove_proc_entry("net/pppoe", NULL); | 1117 | remove_proc_entry("pppoe", init_net.proc_net); |
1117 | proto_unregister(&pppoe_sk_proto); | 1118 | proto_unregister(&pppoe_sk_proto); |
1118 | } | 1119 | } |
1119 | 1120 | ||
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index abe91cb595f4..2eb424ba58e5 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c | |||
@@ -91,6 +91,7 @@ | |||
91 | #include <linux/hash.h> | 91 | #include <linux/hash.h> |
92 | #include <linux/sort.h> | 92 | #include <linux/sort.h> |
93 | #include <linux/proc_fs.h> | 93 | #include <linux/proc_fs.h> |
94 | #include <net/net_namespace.h> | ||
94 | #include <net/dst.h> | 95 | #include <net/dst.h> |
95 | #include <net/ip.h> | 96 | #include <net/ip.h> |
96 | #include <net/udp.h> | 97 | #include <net/udp.h> |
@@ -2444,7 +2445,7 @@ static int __init pppol2tp_init(void) | |||
2444 | goto out_unregister_pppol2tp_proto; | 2445 | goto out_unregister_pppol2tp_proto; |
2445 | 2446 | ||
2446 | #ifdef CONFIG_PROC_FS | 2447 | #ifdef CONFIG_PROC_FS |
2447 | pppol2tp_proc = create_proc_entry("pppol2tp", 0, proc_net); | 2448 | pppol2tp_proc = create_proc_entry("pppol2tp", 0, init_net.proc_net); |
2448 | if (!pppol2tp_proc) { | 2449 | if (!pppol2tp_proc) { |
2449 | err = -ENOMEM; | 2450 | err = -ENOMEM; |
2450 | goto out_unregister_pppox_proto; | 2451 | goto out_unregister_pppox_proto; |
@@ -2469,7 +2470,7 @@ static void __exit pppol2tp_exit(void) | |||
2469 | unregister_pppox_proto(PX_PROTO_OL2TP); | 2470 | unregister_pppox_proto(PX_PROTO_OL2TP); |
2470 | 2471 | ||
2471 | #ifdef CONFIG_PROC_FS | 2472 | #ifdef CONFIG_PROC_FS |
2472 | remove_proc_entry("pppol2tp", proc_net); | 2473 | remove_proc_entry("pppol2tp", init_net.proc_net); |
2473 | #endif | 2474 | #endif |
2474 | proto_unregister(&pppol2tp_sk_proto); | 2475 | proto_unregister(&pppol2tp_sk_proto); |
2475 | } | 2476 | } |
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index 5d849c089a3b..fc4495581f96 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c | |||
@@ -123,6 +123,7 @@ | |||
123 | #include <linux/bitops.h> | 123 | #include <linux/bitops.h> |
124 | #include <linux/jiffies.h> | 124 | #include <linux/jiffies.h> |
125 | 125 | ||
126 | #include <net/net_namespace.h> | ||
126 | #include <net/checksum.h> | 127 | #include <net/checksum.h> |
127 | 128 | ||
128 | #include <asm/io.h> | 129 | #include <asm/io.h> |
@@ -250,7 +251,7 @@ static int __devinit streamer_init_one(struct pci_dev *pdev, | |||
250 | #if STREAMER_NETWORK_MONITOR | 251 | #if STREAMER_NETWORK_MONITOR |
251 | #ifdef CONFIG_PROC_FS | 252 | #ifdef CONFIG_PROC_FS |
252 | if (!dev_streamer) | 253 | if (!dev_streamer) |
253 | create_proc_read_entry("net/streamer_tr", 0, 0, | 254 | create_proc_read_entry("streamer_tr", 0, init_net.proc_net, |
254 | streamer_proc_info, NULL); | 255 | streamer_proc_info, NULL); |
255 | streamer_priv->next = dev_streamer; | 256 | streamer_priv->next = dev_streamer; |
256 | dev_streamer = streamer_priv; | 257 | dev_streamer = streamer_priv; |
@@ -423,7 +424,7 @@ static void __devexit streamer_remove_one(struct pci_dev *pdev) | |||
423 | } | 424 | } |
424 | } | 425 | } |
425 | if (!dev_streamer) | 426 | if (!dev_streamer) |
426 | remove_proc_entry("net/streamer_tr", NULL); | 427 | remove_proc_entry("streamer_tr", init_net.proc_net); |
427 | } | 428 | } |
428 | #endif | 429 | #endif |
429 | #endif | 430 | #endif |
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 09b3cfb8e809..c323101a895b 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -102,6 +102,7 @@ | |||
102 | #include <linux/jiffies.h> | 102 | #include <linux/jiffies.h> |
103 | 103 | ||
104 | #include <net/checksum.h> | 104 | #include <net/checksum.h> |
105 | #include <net/net_namespace.h> | ||
105 | 106 | ||
106 | #include <asm/io.h> | 107 | #include <asm/io.h> |
107 | #include <asm/system.h> | 108 | #include <asm/system.h> |
@@ -268,9 +269,9 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device | |||
268 | printk("Olympic: %s registered as: %s\n",olympic_priv->olympic_card_name,dev->name); | 269 | printk("Olympic: %s registered as: %s\n",olympic_priv->olympic_card_name,dev->name); |
269 | if (olympic_priv->olympic_network_monitor) { /* Must go after register_netdev as we need the device name */ | 270 | if (olympic_priv->olympic_network_monitor) { /* Must go after register_netdev as we need the device name */ |
270 | char proc_name[20] ; | 271 | char proc_name[20] ; |
271 | strcpy(proc_name,"net/olympic_") ; | 272 | strcpy(proc_name,"olympic_") ; |
272 | strcat(proc_name,dev->name) ; | 273 | strcat(proc_name,dev->name) ; |
273 | create_proc_read_entry(proc_name,0,NULL,olympic_proc_info,(void *)dev) ; | 274 | create_proc_read_entry(proc_name,0,init_net.proc_net,olympic_proc_info,(void *)dev) ; |
274 | printk("Olympic: Network Monitor information: /proc/%s\n",proc_name); | 275 | printk("Olympic: Network Monitor information: /proc/%s\n",proc_name); |
275 | } | 276 | } |
276 | return 0 ; | 277 | return 0 ; |
@@ -1752,9 +1753,9 @@ static void __devexit olympic_remove_one(struct pci_dev *pdev) | |||
1752 | 1753 | ||
1753 | if (olympic_priv->olympic_network_monitor) { | 1754 | if (olympic_priv->olympic_network_monitor) { |
1754 | char proc_name[20] ; | 1755 | char proc_name[20] ; |
1755 | strcpy(proc_name,"net/olympic_") ; | 1756 | strcpy(proc_name,"olympic_") ; |
1756 | strcat(proc_name,dev->name) ; | 1757 | strcat(proc_name,dev->name) ; |
1757 | remove_proc_entry(proc_name,NULL); | 1758 | remove_proc_entry(proc_name,init_net.proc_net); |
1758 | } | 1759 | } |
1759 | unregister_netdev(dev) ; | 1760 | unregister_netdev(dev) ; |
1760 | iounmap(olympic_priv->olympic_mmio) ; | 1761 | iounmap(olympic_priv->olympic_mmio) ; |
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 | ||
1094 | static int __init hostap_init(void) | 1095 | static 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 | ||
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index ef32a5c1e818..edb214e8c744 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
@@ -107,6 +107,7 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE"; | |||
107 | #include <linux/serialP.h> | 107 | #include <linux/serialP.h> |
108 | #include <linux/rcupdate.h> | 108 | #include <linux/rcupdate.h> |
109 | #include <net/arp.h> | 109 | #include <net/arp.h> |
110 | #include <net/net_namespace.h> | ||
110 | 111 | ||
111 | #include <linux/ip.h> | 112 | #include <linux/ip.h> |
112 | #include <linux/tcp.h> | 113 | #include <linux/tcp.h> |
@@ -2787,7 +2788,7 @@ static int __init strip_init_driver(void) | |||
2787 | /* | 2788 | /* |
2788 | * Register the status file with /proc | 2789 | * Register the status file with /proc |
2789 | */ | 2790 | */ |
2790 | proc_net_fops_create("strip", S_IFREG | S_IRUGO, &strip_seq_fops); | 2791 | proc_net_fops_create(&init_net, "strip", S_IFREG | S_IRUGO, &strip_seq_fops); |
2791 | 2792 | ||
2792 | return status; | 2793 | return status; |
2793 | } | 2794 | } |
@@ -2809,7 +2810,7 @@ static void __exit strip_exit_driver(void) | |||
2809 | } | 2810 | } |
2810 | 2811 | ||
2811 | /* Unregister with the /proc/net file here. */ | 2812 | /* Unregister with the /proc/net file here. */ |
2812 | proc_net_remove("strip"); | 2813 | proc_net_remove(&init_net, "strip"); |
2813 | 2814 | ||
2814 | if ((i = tty_unregister_ldisc(N_STRIP))) | 2815 | if ((i = tty_unregister_ldisc(N_STRIP))) |
2815 | printk(KERN_ERR "STRIP: can't unregister line discipline (err = %d)\n", i); | 2816 | printk(KERN_ERR "STRIP: can't unregister line discipline (err = %d)\n", i); |