Skip to contentSkip to conversation

net: fix checking boundary of valid vlan id

PATCH New [email protected] 1 participant 1 message Dec 30, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fix checking boundary of valid vlan id

From: Amos Kong <[email protected]>

According to IEEE 802.1Q, 4096 is not a valid vlan id, 4095 is reserved.

---
 net/bridge/netfilter/ebt_vlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/bridge/netfilter/ebt_vlan.c +2 -2
index eae67bf..5bdebc3 100644
@@ -121,8 +121,8 @@ static int ebt_vlan_mt_check(const struct xt_mtchk_param *par)
 	 * if_vlan.h: VLAN_N_VID 4096. */
 	if (GET_BITMASK(EBT_VLAN_ID)) {
 		if (!!info->id) { /* if id!=0 => check vid range */
-			if (info->id > VLAN_N_VID) {
-				pr_debug("id %d is out of range (1-4096)\n",
+			if (info->id >= VLAN_N_VID - 1) {
+				pr_debug("id %d is out of range (1-4094)\n",
 					 info->id);
 				return -EINVAL;
 			}
Signature · 1 line
1.7.11.7