aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan_core.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index fcc684678af6..5940366fac48 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -63,6 +63,27 @@ bool vlan_do_receive(struct sk_buff **skbp)
63 return true; 63 return true;
64} 64}
65 65
66/* Must be invoked with rcu_read_lock or with RTNL. */
67struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
68 u16 vlan_id)
69{
70 struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp);
71
72 if (grp) {
73 return vlan_group_get_device(grp, vlan_id);
74 } else {
75 /*
76 * Bonding slaves do not have grp assigned to themselves.
77 * Grp is assigned to bonding master instead.
78 */
79 if (netif_is_bond_slave(real_dev))
80 return __vlan_find_dev_deep(real_dev->master, vlan_id);
81 }
82
83 return NULL;
84}
85EXPORT_SYMBOL(__vlan_find_dev_deep);
86
66struct net_device *vlan_dev_real_dev(const struct net_device *dev) 87struct net_device *vlan_dev_real_dev(const struct net_device *dev)
67{ 88{
68 return vlan_dev_info(dev)->real_dev; 89 return vlan_dev_info(dev)->real_dev;