[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120928123258.9454.95197.stgit@localhost.localdomain>
Date: Fri, 28 Sep 2012 15:32:58 +0300
From: Paulius Zaleckas <paulius.zaleckas@...il.com>
To: kaber@...sh.net, netdev@...r.kernel.org
Subject: [PATCH] vlan: Make it possible to add vlan with id 4095
vconfig help tells that vlan_id should be 0-4095, but fails
with 4095.
There is an off-by-one bug while evaluating vlan_id.
Fix it by evaluating against count(4096), not mask(0x0fff = 4095).
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@...il.com>
---
net/8021q/vlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 9096bcb..9e528bf 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -199,7 +199,7 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
char name[IFNAMSIZ];
int err;
- if (vlan_id >= VLAN_VID_MASK)
+ if (vlan_id >= VLAN_N_VID)
return -ERANGE;
err = vlan_check_real_dev(real_dev, vlan_id);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists