aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-01-31 07:08:10 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:27:46 -0500
commit2f0d2f10391e190f940da70cbdc8a61e4dad98eb (patch)
treed732ec9ecf934264525254873c5cc5aa18afce15
parent4e26fe2681e9e3a4a43daab70c9facba3310755b (diff)
[NETFILTER]: conntrack: get rid of sparse warnings
Teach sparse about locking here, and fix signed/unsigned warnings. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/nf_conntrack_irc.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c4
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c6
-rw-r--r--net/netfilter/nf_conntrack_sip.c4
-rw-r--r--net/netfilter/nf_conntrack_standalone.c2
-rw-r--r--net/netfilter/nf_conntrack_tftp.c2
6 files changed, 11 insertions, 9 deletions
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
index dfaed4ba83cd..c336b07a0d4c 100644
--- a/net/netfilter/nf_conntrack_irc.c
+++ b/net/netfilter/nf_conntrack_irc.c
@@ -23,7 +23,7 @@
23 23
24#define MAX_PORTS 8 24#define MAX_PORTS 8
25static unsigned short ports[MAX_PORTS]; 25static unsigned short ports[MAX_PORTS];
26static int ports_c; 26static unsigned int ports_c;
27static unsigned int max_dcc_channels = 8; 27static unsigned int max_dcc_channels = 8;
28static unsigned int dcc_timeout __read_mostly = 300; 28static unsigned int dcc_timeout __read_mostly = 300;
29/* This is slow, but it's simple. --RR */ 29/* This is slow, but it's simple. --RR */
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 21d29e782baf..7017b161a14b 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -624,7 +624,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6 __read_mostly = {
624#endif 624#endif
625}; 625};
626 626
627int __init nf_conntrack_proto_sctp_init(void) 627static int __init nf_conntrack_proto_sctp_init(void)
628{ 628{
629 int ret; 629 int ret;
630 630
@@ -647,7 +647,7 @@ int __init nf_conntrack_proto_sctp_init(void)
647 return ret; 647 return ret;
648} 648}
649 649
650void __exit nf_conntrack_proto_sctp_fini(void) 650static void __exit nf_conntrack_proto_sctp_fini(void)
651{ 651{
652 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp6); 652 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp6);
653 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp4); 653 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp4);
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 64c9b910419c..8e2207535665 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -1098,16 +1098,16 @@ static const struct nla_policy tcp_nla_policy[CTA_PROTOINFO_TCP_MAX+1] = {
1098 1098
1099static int nlattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct) 1099static int nlattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct)
1100{ 1100{
1101 struct nlattr *attr = cda[CTA_PROTOINFO_TCP]; 1101 struct nlattr *pattr = cda[CTA_PROTOINFO_TCP];
1102 struct nlattr *tb[CTA_PROTOINFO_TCP_MAX+1]; 1102 struct nlattr *tb[CTA_PROTOINFO_TCP_MAX+1];
1103 int err; 1103 int err;
1104 1104
1105 /* updates could not contain anything about the private 1105 /* updates could not contain anything about the private
1106 * protocol info, in that case skip the parsing */ 1106 * protocol info, in that case skip the parsing */
1107 if (!attr) 1107 if (!pattr)
1108 return 0; 1108 return 0;
1109 1109
1110 err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr, tcp_nla_policy); 1110 err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, pattr, tcp_nla_policy);
1111 if (err < 0) 1111 if (err < 0)
1112 return err; 1112 return err;
1113 1113
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 47d8947cf263..775f7d468105 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -28,7 +28,7 @@ MODULE_ALIAS("ip_conntrack_sip");
28 28
29#define MAX_PORTS 8 29#define MAX_PORTS 8
30static unsigned short ports[MAX_PORTS]; 30static unsigned short ports[MAX_PORTS];
31static int ports_c; 31static unsigned int ports_c;
32module_param_array(ports, ushort, &ports_c, 0400); 32module_param_array(ports, ushort, &ports_c, 0400);
33MODULE_PARM_DESC(ports, "port numbers of SIP servers"); 33MODULE_PARM_DESC(ports, "port numbers of SIP servers");
34 34
@@ -407,7 +407,7 @@ static int sip_help(struct sk_buff *skb,
407 unsigned int dataoff, datalen; 407 unsigned int dataoff, datalen;
408 const char *dptr; 408 const char *dptr;
409 int ret = NF_ACCEPT; 409 int ret = NF_ACCEPT;
410 int matchoff, matchlen; 410 unsigned int matchoff, matchlen;
411 u_int16_t port; 411 u_int16_t port;
412 enum sip_header_pos pos; 412 enum sip_header_pos pos;
413 typeof(nf_nat_sip_hook) nf_nat_sip; 413 typeof(nf_nat_sip_hook) nf_nat_sip;
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index 696074a037c1..28c5ae8f5625 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -93,6 +93,7 @@ static struct hlist_node *ct_get_idx(struct seq_file *seq, loff_t pos)
93} 93}
94 94
95static void *ct_seq_start(struct seq_file *seq, loff_t *pos) 95static void *ct_seq_start(struct seq_file *seq, loff_t *pos)
96 __acquires(nf_conntrack_lock)
96{ 97{
97 read_lock_bh(&nf_conntrack_lock); 98 read_lock_bh(&nf_conntrack_lock);
98 return ct_get_idx(seq, *pos); 99 return ct_get_idx(seq, *pos);
@@ -105,6 +106,7 @@ static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos)
105} 106}
106 107
107static void ct_seq_stop(struct seq_file *s, void *v) 108static void ct_seq_stop(struct seq_file *s, void *v)
109 __releases(nf_conntrack_lock)
108{ 110{
109 read_unlock_bh(&nf_conntrack_lock); 111 read_unlock_bh(&nf_conntrack_lock);
110} 112}
diff --git a/net/netfilter/nf_conntrack_tftp.c b/net/netfilter/nf_conntrack_tftp.c
index e894aa1ff3ad..176f769d3072 100644
--- a/net/netfilter/nf_conntrack_tftp.c
+++ b/net/netfilter/nf_conntrack_tftp.c
@@ -25,7 +25,7 @@ MODULE_ALIAS("ip_conntrack_tftp");
25 25
26#define MAX_PORTS 8 26#define MAX_PORTS 8
27static unsigned short ports[MAX_PORTS]; 27static unsigned short ports[MAX_PORTS];
28static int ports_c; 28static unsigned int ports_c;
29module_param_array(ports, ushort, &ports_c, 0400); 29module_param_array(ports, ushort, &ports_c, 0400);
30MODULE_PARM_DESC(ports, "Port numbers of TFTP servers"); 30MODULE_PARM_DESC(ports, "Port numbers of TFTP servers");
31 31