Subject: [PATCH 1/3] vlan: Do not support clearing VLAN_FLAG_REORDER_HDR

From: [email-masked] (Eric W. Biederman)
Date: Sun, 22 May 2011 12:39:18 -0700

Simplify the vlan handling code by not supporing clearing of
VLAN_FLAG_REORDER_HDR.  Which means we always make the vlan handling
code strip the vlan header from the packets, and always insert the vlan
header when transmitting packets.

Not stripping the vlan header has alwasy been broken in combination with
vlan hardware accelleration.  Now that we are making everything look
like accelerated vlan handling not stripping the vlan header is always
broken.

I don't think anyone actually cares so simply stop supporting the broken
case.

Signed-off-by: Eric W. Biederman <[email-masked]>
---
 net/8021q/vlan_dev.c     |    3 +--
 net/8021q/vlan_netlink.c |    4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index f247f5b..20629fe 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -242,8 +242,7 @@ int vlan_dev_change_flags(const struct net_device *dev, u32 flags, u32 mask)
 	struct vlan_dev_info *vlan = vlan_dev_info(dev);
 	u32 old_flags = vlan->flags;
 
-	if (mask & ~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP |
-		     VLAN_FLAG_LOOSE_BINDING))
+	if (mask & ~(VLAN_FLAG_GVRP | VLAN_FLAG_LOOSE_BINDING))
 		return -EINVAL;
 
 	vlan->flags = (old_flags & ~mask) | (flags & mask);
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index be9a5c1..a638a4c 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -59,9 +59,7 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[])
 	}
 	if (data[IFLA_VLAN_FLAGS]) {
 		flags = nla_data(data[IFLA_VLAN_FLAGS]);
-		if ((flags->flags & flags->mask) &
-		    ~(VLAN_FLAG_REORDER_HDR | VLAN_FLAG_GVRP |
-		      VLAN_FLAG_LOOSE_BINDING))
+		if (flags->mask & ~(VLAN_FLAG_GVRP | VLAN_FLAG_LOOSE_BINDING))
 			return -EINVAL;
 	}
 
-- 
1.7.5.1.217.g4e3aa