From patchwork Mon Nov 24 00:06:52 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: kbuild test robot X-Patchwork-Id: 10345 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 1F92ADDDFB for ; Mon, 24 Nov 2008 11:07:23 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589AbYKXAHI (ORCPT ); Sun, 23 Nov 2008 19:07:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751180AbYKXAHG (ORCPT ); Sun, 23 Nov 2008 19:07:06 -0500 Received: from mga03.intel.com ([143.182.124.21]:52020 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750887AbYKXAHF (ORCPT ); Sun, 23 Nov 2008 19:07:05 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 23 Nov 2008 16:07:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.33,655,1220252400"; d="scan'208";a="81272286" Received: from unknown (HELO localhost) ([10.254.153.180]) by azsmga001.ch.intel.com with ESMTP; 23 Nov 2008 16:06:56 -0800 Received: from wfg by localhost with local (Exim 4.69) (envelope-from ) id 1L4Oyb-0001Si-0S; Mon, 24 Nov 2008 08:06:53 +0800 Date: Mon, 24 Nov 2008 08:06:52 +0800 From: Wu Fengguang To: David Miller Cc: "kaber@trash.net" , "linux-net@vger.kernel.org" , "netdev@vger.kernel.org" Subject: Re: [PATCH] netfilter: nf_conntrack_sctp: fix build warning Message-ID: <20081124000652.GA5424@localhost> References: <20081123113315.GA16697@localhost> <20081123.135955.202482968.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20081123.135955.202482968.davem@davemloft.net> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Nov 23, 2008 at 11:59:55PM +0200, David Miller wrote: > From: Wu Fengguang > Date: Sun, 23 Nov 2008 19:33:15 +0800 > > linux-net is not the mailing list for network development > discussion, it is for user questions. Post patches and > developer questions to netdev@vger.kernel.org instead. OK, thanks for the CC! Fengguang --- net/netfilter/nf_conntrack_proto_sctp.c: In function ‘sctp_packet’: net/netfilter/nf_conntrack_proto_sctp.c:376: warning: array subscript is above array bounds Signed-off-by: Wu Fengguang --- DISCLAIMER: I'm newbie to the code, and this fix could be wrong! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index ae8c260..d31ced4 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c @@ -373,6 +373,9 @@ static int sctp_packet(struct nf_conn *ct, } write_unlock_bh(&sctp_lock); + if (new_state == SCTP_CONNTRACK_MAX) + goto out; + nf_ct_refresh_acct(ct, ctinfo, skb, sctp_timeouts[new_state]); if (old_state == SCTP_CONNTRACK_COOKIE_ECHOED &&