From: Stephen Hemminger <shemminger@vyatta.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 5/8] conntrack: get rid of sparse warnings
Date: Thu, 24 Jan 2008 10:15:41 -0800 [thread overview]
Message-ID: <20080124181628.315779855@vyatta.com> (raw)
In-Reply-To: 20080124181536.446214111@vyatta.com
[-- Attachment #1: nf-conntrack-sparse.patch --]
[-- Type: text/plain, Size: 4391 bytes --]
Teach sparse about locking here, and fix signed/unsigned warnings.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/netfilter/nf_conntrack_standalone.c 2008-01-23 10:06:11.000000000 -0800
+++ b/net/netfilter/nf_conntrack_standalone.c 2008-01-23 10:06:33.000000000 -0800
@@ -93,6 +93,7 @@ static struct hlist_node *ct_get_idx(str
}
static void *ct_seq_start(struct seq_file *seq, loff_t *pos)
+ __acquires(nf_conntrack_lock)
{
read_lock_bh(&nf_conntrack_lock);
return ct_get_idx(seq, *pos);
@@ -105,6 +106,7 @@ static void *ct_seq_next(struct seq_file
}
static void ct_seq_stop(struct seq_file *s, void *v)
+ __releases(nf_conntrack_lock)
{
read_unlock_bh(&nf_conntrack_lock);
}
--- a/net/netfilter/nf_conntrack_expect.c 2008-01-23 10:07:46.000000000 -0800
+++ b/net/netfilter/nf_conntrack_expect.c 2008-01-23 10:08:21.000000000 -0800
@@ -427,6 +427,7 @@ static struct hlist_node *ct_expect_get_
}
static void *exp_seq_start(struct seq_file *seq, loff_t *pos)
+ __acquires(nf_conntrack_lock)
{
read_lock_bh(&nf_conntrack_lock);
return ct_expect_get_idx(seq, *pos);
@@ -439,6 +440,7 @@ static void *exp_seq_next(struct seq_fil
}
static void exp_seq_stop(struct seq_file *seq, void *v)
+ __releases(nf_conntrack_lock)
{
read_unlock_bh(&nf_conntrack_lock);
}
--- a/net/netfilter/nf_conntrack_irc.c 2008-01-23 10:12:33.000000000 -0800
+++ b/net/netfilter/nf_conntrack_irc.c 2008-01-23 10:14:55.000000000 -0800
@@ -23,7 +23,7 @@
#define MAX_PORTS 8
static unsigned short ports[MAX_PORTS];
-static int ports_c;
+static unsigned int ports_c;
static unsigned int max_dcc_channels = 8;
static unsigned int dcc_timeout __read_mostly = 300;
/* This is slow, but it's simple. --RR */
--- a/net/netfilter/nf_conntrack_proto_sctp.c 2008-01-23 10:11:29.000000000 -0800
+++ b/net/netfilter/nf_conntrack_proto_sctp.c 2008-01-23 10:11:42.000000000 -0800
@@ -624,7 +624,7 @@ static struct nf_conntrack_l4proto nf_co
#endif
};
-int __init nf_conntrack_proto_sctp_init(void)
+static int __init nf_conntrack_proto_sctp_init(void)
{
int ret;
@@ -647,7 +647,7 @@ int __init nf_conntrack_proto_sctp_init(
return ret;
}
-void __exit nf_conntrack_proto_sctp_fini(void)
+static void __exit nf_conntrack_proto_sctp_fini(void)
{
nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp6);
nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp4);
--- a/net/netfilter/nf_conntrack_proto_tcp.c 2008-01-23 10:10:47.000000000 -0800
+++ b/net/netfilter/nf_conntrack_proto_tcp.c 2008-01-23 10:11:15.000000000 -0800
@@ -1098,16 +1098,16 @@ static const struct nla_policy tcp_nla_p
static int nlattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct)
{
- struct nlattr *attr = cda[CTA_PROTOINFO_TCP];
+ struct nlattr *pattr = cda[CTA_PROTOINFO_TCP];
struct nlattr *tb[CTA_PROTOINFO_TCP_MAX+1];
int err;
/* updates could not contain anything about the private
* protocol info, in that case skip the parsing */
- if (!attr)
+ if (!pattr)
return 0;
- err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr, tcp_nla_policy);
+ err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, pattr, tcp_nla_policy);
if (err < 0)
return err;
--- a/net/netfilter/nf_conntrack_sip.c 2008-01-23 10:14:38.000000000 -0800
+++ b/net/netfilter/nf_conntrack_sip.c 2008-01-23 10:15:23.000000000 -0800
@@ -28,7 +28,7 @@ MODULE_ALIAS("ip_conntrack_sip");
#define MAX_PORTS 8
static unsigned short ports[MAX_PORTS];
-static int ports_c;
+static unsigned int ports_c;
module_param_array(ports, ushort, &ports_c, 0400);
MODULE_PARM_DESC(ports, "port numbers of SIP servers");
@@ -407,7 +407,7 @@ static int sip_help(struct sk_buff *skb,
unsigned int dataoff, datalen;
const char *dptr;
int ret = NF_ACCEPT;
- int matchoff, matchlen;
+ unsigned int matchoff, matchlen;
u_int16_t port;
enum sip_header_pos pos;
typeof(nf_nat_sip_hook) nf_nat_sip;
--- a/net/netfilter/nf_conntrack_tftp.c 2008-01-23 10:15:35.000000000 -0800
+++ b/net/netfilter/nf_conntrack_tftp.c 2008-01-23 10:15:50.000000000 -0800
@@ -25,7 +25,7 @@ MODULE_ALIAS("ip_conntrack_tftp");
#define MAX_PORTS 8
static unsigned short ports[MAX_PORTS];
-static int ports_c;
+static unsigned int ports_c;
module_param_array(ports, ushort, &ports_c, 0400);
MODULE_PARM_DESC(ports, "Port numbers of TFTP servers");
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
next prev parent reply other threads:[~2008-01-24 18:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger
2008-01-24 18:15 ` [PATCH 1/8] nf_nat_snmp: sparse warning Stephen Hemminger
2008-01-24 18:32 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 2/8] netfilter: get rid of " Stephen Hemminger
2008-01-24 18:34 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 3/8] nf_conntrack: sparse warnings Stephen Hemminger
2008-01-24 18:35 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 4/8] netfilter: more sparse warning fixes Stephen Hemminger
2008-01-24 18:40 ` Patrick McHardy
2008-01-24 18:15 ` Stephen Hemminger [this message]
2008-01-24 18:42 ` [PATCH 5/8] conntrack: get rid of sparse warnings Patrick McHardy
2008-01-24 18:15 ` [PATCH 6/8] nf_conntrack-h323: sparse fixes Stephen Hemminger
2008-01-24 18:44 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 7/8] netfilter: more spase fixes Stephen Hemminger
2008-01-24 18:43 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix Stephen Hemminger
2008-01-24 18:45 ` Patrick McHardy
2008-01-25 1:24 ` Yasuyuki KOZAKAI
2008-01-28 2:50 ` Yasuyuki KOZAKAI
[not found] ` <200801280250.m0S2oWF1019241@toshiba.co.jp>
2008-01-29 12:54 ` Patrick McHardy
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=20080124181628.315779855@vyatta.com \
--to=shemminger@vyatta.com \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.