Commit 30688a9a3e06d83d187658bd1c15f0e306bed38b
Committed by
David S. Miller
1 parent
65d292a2ef
Exists in
master
and in
4 other branches
[VLAN]: Handle vlan devices net namespace changing.
When van device is moved to another namespace proc files, related to this device, should also change one. Use the netdev REGISTER and UNREGISTER event handlers for this. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 8 additions and 5 deletions Side-by-side Diff
net/8021q/vlan.c
... | ... | @@ -154,8 +154,6 @@ |
154 | 154 | grp = __vlan_find_group(real_dev); |
155 | 155 | BUG_ON(!grp); |
156 | 156 | |
157 | - vlan_proc_rem_dev(dev); | |
158 | - | |
159 | 157 | /* Take it out of our own structures, but be sure to interlock with |
160 | 158 | * HW accelerating devices or SW vlan input packet processing. |
161 | 159 | */ |
... | ... | @@ -278,9 +276,6 @@ |
278 | 276 | if (real_dev->features & NETIF_F_HW_VLAN_FILTER) |
279 | 277 | real_dev->vlan_rx_add_vid(real_dev, vlan_id); |
280 | 278 | |
281 | - if (vlan_proc_add_dev(dev) < 0) | |
282 | - pr_warning("8021q: failed to add proc entry for %s\n", | |
283 | - dev->name); | |
284 | 279 | return 0; |
285 | 280 | |
286 | 281 | out_free_group: |
... | ... | @@ -395,6 +390,14 @@ |
395 | 390 | if (vlan_proc_add_dev(dev) < 0) |
396 | 391 | pr_warning("8021q: failed to change proc name for %s\n", |
397 | 392 | dev->name); |
393 | + break; | |
394 | + case NETDEV_REGISTER: | |
395 | + if (vlan_proc_add_dev(dev) < 0) | |
396 | + pr_warning("8021q: failed to add proc entry for %s\n", | |
397 | + dev->name); | |
398 | + break; | |
399 | + case NETDEV_UNREGISTER: | |
400 | + vlan_proc_rem_dev(dev); | |
398 | 401 | break; |
399 | 402 | } |
400 | 403 | } |