Skip to content

Commit

Permalink
vlan: make vlan_dev_real_dev work over stacked vlans
Browse files Browse the repository at this point in the history
Sometimes we might have stacked vlans on top of each other, and we're
interested in the first non-vlan real device on the path, so transform
vlan_dev_real_dev to go over the stacked vlans and extract the first
non-vlan device.

Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: Veaceslav Falico <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
[email protected] authored and davem330 committed Aug 5, 2013
1 parent d9af2d6 commit 0369722
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/8021q/vlan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ EXPORT_SYMBOL(__vlan_find_dev_deep);

struct net_device *vlan_dev_real_dev(const struct net_device *dev)
{
return vlan_dev_priv(dev)->real_dev;
struct net_device *ret = vlan_dev_priv(dev)->real_dev;

while (is_vlan_dev(ret))
ret = vlan_dev_priv(ret)->real_dev;

return ret;
}
EXPORT_SYMBOL(vlan_dev_real_dev);

Expand Down

0 comments on commit 0369722

Please sign in to comment.