Commit 126d6c23 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

vlan: add link to upper device

Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7cd43db7
...@@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) ...@@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
*/ */
unregister_netdevice_queue(dev, head); unregister_netdevice_queue(dev, head);
netdev_upper_dev_unlink(real_dev, dev);
if (grp->nr_vlan_devs == 0) if (grp->nr_vlan_devs == 0)
vlan_gvrp_uninit_applicant(real_dev); vlan_gvrp_uninit_applicant(real_dev);
...@@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev) ...@@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev)
if (err < 0) if (err < 0)
goto out_uninit_applicant; goto out_uninit_applicant;
err = netdev_upper_dev_link(real_dev, dev);
if (err)
goto out_uninit_applicant;
err = register_netdevice(dev); err = register_netdevice(dev);
if (err < 0) if (err < 0)
goto out_uninit_applicant; goto out_upper_dev_unlink;
/* Account for reference in struct vlan_dev_priv */ /* Account for reference in struct vlan_dev_priv */
dev_hold(real_dev); dev_hold(real_dev);
...@@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev) ...@@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev)
return 0; return 0;
out_upper_dev_unlink:
netdev_upper_dev_unlink(real_dev, dev);
out_uninit_applicant: out_uninit_applicant:
if (grp->nr_vlan_devs == 0) if (grp->nr_vlan_devs == 0)
vlan_gvrp_uninit_applicant(real_dev); vlan_gvrp_uninit_applicant(real_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment