summaryrefslogtreecommitdiffstats
path: root/net/8021q/vlan.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-03 23:48:51 +0100
committerDavid S. Miller <davem@davemloft.net>2013-01-04 22:31:49 +0100
commit126d6c236bb817c8752be41884e4c72a52a50f92 (patch)
tree13817c389ae5894dc6a536b9d61f0fefdab64a53 /net/8021q/vlan.c
parentmacvlan: add link to upper device (diff)
downloadlinux-126d6c236bb817c8752be41884e4c72a52a50f92.tar.xz
linux-126d6c236bb817c8752be41884e4c72a52a50f92.zip
vlan: add link to upper device
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.c')
-rw-r--r--net/8021q/vlan.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index a292e8050ef2..babfde9f734c 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
*/
unregister_netdevice_queue(dev, head);
+ netdev_upper_dev_unlink(real_dev, dev);
+
if (grp->nr_vlan_devs == 0)
vlan_gvrp_uninit_applicant(real_dev);
@@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev)
if (err < 0)
goto out_uninit_applicant;
+ err = netdev_upper_dev_link(real_dev, dev);
+ if (err)
+ goto out_uninit_applicant;
+
err = register_netdevice(dev);
if (err < 0)
- goto out_uninit_applicant;
+ goto out_upper_dev_unlink;
/* Account for reference in struct vlan_dev_priv */
dev_hold(real_dev);
@@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev)
return 0;
+out_upper_dev_unlink:
+ netdev_upper_dev_unlink(real_dev, dev);
out_uninit_applicant:
if (grp->nr_vlan_devs == 0)
vlan_gvrp_uninit_applicant(real_dev);