aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/8021q/vlanproc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 995544b89071..cc17b722078a 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -80,7 +80,8 @@ static const struct seq_operations vlan_seq_ops = {
80 80
81static int vlan_seq_open(struct inode *inode, struct file *file) 81static int vlan_seq_open(struct inode *inode, struct file *file)
82{ 82{
83 return seq_open(file, &vlan_seq_ops); 83 return seq_open_net(inode, file, &vlan_seq_ops,
84 sizeof(struct seq_net_private));
84} 85}
85 86
86static const struct file_operations vlan_fops = { 87static const struct file_operations vlan_fops = {
@@ -88,7 +89,7 @@ static const struct file_operations vlan_fops = {
88 .open = vlan_seq_open, 89 .open = vlan_seq_open,
89 .read = seq_read, 90 .read = seq_read,
90 .llseek = seq_lseek, 91 .llseek = seq_lseek,
91 .release = seq_release, 92 .release = seq_release_net,
92}; 93};
93 94
94/* 95/*
@@ -211,6 +212,7 @@ static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
211 __acquires(dev_base_lock) 212 __acquires(dev_base_lock)
212{ 213{
213 struct net_device *dev; 214 struct net_device *dev;
215 struct net *net = seq_file_net(seq);
214 loff_t i = 1; 216 loff_t i = 1;
215 217
216 read_lock(&dev_base_lock); 218 read_lock(&dev_base_lock);
@@ -218,7 +220,7 @@ static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
218 if (*pos == 0) 220 if (*pos == 0)
219 return SEQ_START_TOKEN; 221 return SEQ_START_TOKEN;
220 222
221 for_each_netdev(&init_net, dev) { 223 for_each_netdev(net, dev) {
222 if (!is_vlan_dev(dev)) 224 if (!is_vlan_dev(dev))
223 continue; 225 continue;
224 226
@@ -232,14 +234,15 @@ static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
232static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) 234static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
233{ 235{
234 struct net_device *dev; 236 struct net_device *dev;
237 struct net *net = seq_file_net(seq);
235 238
236 ++*pos; 239 ++*pos;
237 240
238 dev = (struct net_device *)v; 241 dev = (struct net_device *)v;
239 if (v == SEQ_START_TOKEN) 242 if (v == SEQ_START_TOKEN)
240 dev = net_device_entry(&init_net.dev_base_head); 243 dev = net_device_entry(&net->dev_base_head);
241 244
242 for_each_netdev_continue(&init_net, dev) { 245 for_each_netdev_continue(net, dev) {
243 if (!is_vlan_dev(dev)) 246 if (!is_vlan_dev(dev))
244 continue; 247 continue;
245 248