[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081124011727.GA6462@localhost>
Date: Mon, 24 Nov 2008 09:17:27 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: Wang Chen <wangchen@...fujitsu.com>
Cc: David Miller <davem@...emloft.net>,
"kaber@...sh.net" <kaber@...sh.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] netfilter: nf_conntrack_sctp: fix build warning
On Mon, Nov 24, 2008 at 03:08:57AM +0200, Wang Chen wrote:
> Wu Fengguang said the following on 2008-11-24 8:06:
> > On Sun, Nov 23, 2008 at 11:59:55PM +0200, David Miller wrote:
> >> From: Wu Fengguang <fengguang.wu@...el.com>
> >> 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@...r.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 <wfg@...ux.intel.com>
> > ---
> >
> > DISCLAIMER: I'm newbie to the code, and this fix could be wrong!
> >
> > 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;
> > +
>
> print some debug info would be better?
Like this one?
+ pr_debug("Empty sctp packet\n");
Fengguang
---
netfilter: nf_conntrack_sctp: fix build warning
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 <wfg@...ux.intel.com>
---
DISCLAIMER: I'm newbie to the code, and this fix could be wrong!
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index ae8c260..a0bc24b 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -373,6 +373,11 @@ static int sctp_packet(struct nf_conn *ct,
}
write_unlock_bh(&sctp_lock);
+ if (new_state == SCTP_CONNTRACK_MAX) {
+ pr_debug("Empty sctp packet\n");
+ goto out;
+ }
+
nf_ct_refresh_acct(ct, ctinfo, skb, sctp_timeouts[new_state]);
if (old_state == SCTP_CONNTRACK_COOKIE_ECHOED &&
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists