netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: akong@redhat.com
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org, kaber@trash.net
Subject: [PATCH] net: fix checking boundary of valid vlan id
Date: Sun, 30 Dec 2012 17:21:47 +0800	[thread overview]
Message-ID: <1356859307-26205-1-git-send-email-akong@redhat.com> (raw)

From: Amos Kong <akong@redhat.com>

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

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..5bdebc3 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 - 1) {
+				pr_debug("id %d is out of range (1-4094)\n",
 					 info->id);
 				return -EINVAL;
 			}
-- 
1.7.11.7


             reply	other threads:[~2012-12-30  9:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30  9:21 akong [this message]
     [not found] <1356848931-22193-1-git-send-email-akong@redhat.com>
2013-01-03  0:39 ` [PATCH] net: fix checking boundary of valid vlan id Pablo Neira Ayuso
2013-01-03 20:06   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356859307-26205-1-git-send-email-akong@redhat.com \
    --to=akong@redhat.com \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).