From patchwork Sun Dec 30 06:28:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 208713 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DD1F92C00C2 for ; Sun, 30 Dec 2012 17:29:02 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753350Ab2L3G27 (ORCPT ); Sun, 30 Dec 2012 01:28:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22919 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751328Ab2L3G26 (ORCPT ); Sun, 30 Dec 2012 01:28:58 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBU6Sug4001575 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 30 Dec 2012 01:28:56 -0500 Received: from t430s.redhat.com (vpn1-113-75.nay.redhat.com [10.66.113.75]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBU6SsRI013672; Sun, 30 Dec 2012 01:28:54 -0500 From: akong@redhat.com To: netdev@vger.kernel.org Cc: davem@davemloft.net Subject: [PATCH] net: fix checking boundary of valid vlan id Date: Sun, 30 Dec 2012 14:28:51 +0800 Message-Id: <1356848931-22193-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Amos Kong 4096 is not a valid vlan id. Signed-off-by: Amos Kong --- 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; }