Patchwork [net-next,3/3] team: do not allow to add VLAN challenged port when vlan is used

login
register
mail settings
Submitter Jiri Pirko
Date Aug. 23, 2012, 1:26 p.m.
Message ID <1345728413-10298-4-git-send-email-jiri@resnulli.us>
Download mbox | patch
Permalink /patch/179652/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jiri Pirko - Aug. 23, 2012, 1:26 p.m.
Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/team/team.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 4010bcd..49629fb 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;