From: Jiri Pirko Date: Thu, 23 Aug 2012 03:26:53 +0000 (+0000) Subject: team: do not allow to add VLAN challenged port when vlan is used X-Git-Tag: MMI-PSA29.97-13-9~15870^2~279 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c33bb37cb69dc6d86d2ee8edd1d4814990a65fe;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git team: do not allow to add VLAN challenged port when vlan is used Reported-by: Or Gerlitz Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index a5926c8584aa..b4f67b55ef79 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -989,6 +989,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev) return -EBUSY; } + if (port_dev->features & NETIF_F_VLAN_CHALLENGED && + vlan_uses_dev(dev)) { + netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n", + portname); + return -EPERM; + } + err = team_dev_type_check_change(dev, port_dev); if (err) return err;