netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fix checking boundary of valid vlan id
@ 2012-12-30  6:28 akong
  2012-12-30  6:39 ` Amos Kong
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: akong @ 2012-12-30  6:28 UTC (permalink / raw)
  To: netdev; +Cc: davem

From: Amos Kong <akong@redhat.com>

4096 is not a valid vlan id.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 net/bridge/netfilter/ebt_vlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c
index eae67bf..b279ec0 100644
--- a/net/bridge/netfilter/ebt_vlan.c
+++ b/net/bridge/netfilter/ebt_vlan.c
@@ -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) {
+				pr_debug("id %d is out of range (1-4095)\n",
 					 info->id);
 				return -EINVAL;
 			}
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-03 20:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-30  6:28 [PATCH] net: fix checking boundary of valid vlan id akong
2012-12-30  6:39 ` Amos Kong
2012-12-30  7:40 ` David Miller
2012-12-30 12:25 ` Florian Westphal
2012-12-31 11:36   ` Glen Turner
2012-12-31 17:12     ` Benny Amorsen
2012-12-31 22:30       ` Glen Turner
2013-01-03  0:39 ` Pablo Neira Ayuso
2013-01-03 20:06   ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).