diff options
author | nikolay@redhat.com <nikolay@redhat.com> | 2013-08-03 16:07:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-05 15:17:42 -0400 |
commit | 0369722f024cd374f74eac6d261014403aa27ea2 (patch) | |
tree | d73398ccd7bae3ad0a60405f71259f77c8eca430 /net/8021q | |
parent | d9af2d67e490b48f0d36f448d34e7bab9425f142 (diff) |
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: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan_core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 4a78c4de9f20..6ee48aac776f 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -91,7 +91,12 @@ EXPORT_SYMBOL(__vlan_find_dev_deep); | |||
91 | 91 | ||
92 | struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 92 | struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
93 | { | 93 | { |
94 | return vlan_dev_priv(dev)->real_dev; | 94 | struct net_device *ret = vlan_dev_priv(dev)->real_dev; |
95 | |||
96 | while (is_vlan_dev(ret)) | ||
97 | ret = vlan_dev_priv(ret)->real_dev; | ||
98 | |||
99 | return ret; | ||
95 | } | 100 | } |
96 | EXPORT_SYMBOL(vlan_dev_real_dev); | 101 | EXPORT_SYMBOL(vlan_dev_real_dev); |
97 | 102 | ||