diff options
author | Jiri Pirko <jiri@resnulli.us> | 2012-10-14 00:30:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-16 14:41:46 -0400 |
commit | 55462cf30ad9768fff6a6d36db21879146a39bdf (patch) | |
tree | f306def961d7f9ca6cc835c5133c592973f91a0c /net/8021q | |
parent | 73b7656ce4e09eb137ee6f845a9e11a7f132df1c (diff) |
vlan: fix bond/team enslave of vlan challenged slave/port
In vlan_uses_dev() check for number of vlan devs rather than existence
of vlan_info. The reason is that vlan id 0 is there without appropriate
vlan dev on it by default which prevented from enslaving vlan challenged
dev.
Reported-by: Jon Stanley <jstanley@rmrf.net>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan_core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index fbbf1fa00940..65e06abe023f 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -366,6 +366,13 @@ EXPORT_SYMBOL(vlan_vids_del_by_dev); | |||
366 | 366 | ||
367 | bool vlan_uses_dev(const struct net_device *dev) | 367 | bool vlan_uses_dev(const struct net_device *dev) |
368 | { | 368 | { |
369 | return rtnl_dereference(dev->vlan_info) ? true : false; | 369 | struct vlan_info *vlan_info; |
370 | |||
371 | ASSERT_RTNL(); | ||
372 | |||
373 | vlan_info = rtnl_dereference(dev->vlan_info); | ||
374 | if (!vlan_info) | ||
375 | return false; | ||
376 | return vlan_info->grp.nr_vlan_devs ? true : false; | ||
370 | } | 377 | } |
371 | EXPORT_SYMBOL(vlan_uses_dev); | 378 | EXPORT_SYMBOL(vlan_uses_dev); |