Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0369722f authored by nikolay@redhat.com's avatar nikolay@redhat.com Committed by David S. Miller
Browse files

vlan: make vlan_dev_real_dev work over stacked vlans



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: default avatarNikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d9af2d67
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);