* [PATCH 0/8] trivial patches to netfilter for net-2.6.25
@ 2008-01-24 18:15 Stephen Hemminger
2008-01-24 18:15 ` [PATCH 1/8] nf_nat_snmp: sparse warning Stephen Hemminger
` (7 more replies)
0 siblings, 8 replies; 20+ messages in thread
From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netfilter-devel
Doing a bunch of sparse cleanups to try and get rid of most of
the warnings in networking code.
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply [flat|nested] 20+ messages in thread* [PATCH 1/8] nf_nat_snmp: sparse warning 2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger @ 2008-01-24 18:15 ` Stephen Hemminger 2008-01-24 18:32 ` Patrick McHardy 2008-01-24 18:15 ` [PATCH 2/8] netfilter: get rid of " Stephen Hemminger ` (6 subsequent siblings) 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-snmp-sparse.patch --] [-- Type: text/plain, Size: 496 bytes --] Use of 0 as NULL causes sparse complaint. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c 2008-01-23 10:07:23.000000000 -0800 +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c 2008-01-23 10:07:31.000000000 -0800 @@ -260,7 +260,7 @@ static unsigned char asn1_eoc_decode(str { unsigned char ch; - if (eoc == 0) { + if (eoc == NULL) { if (!asn1_octet_decode(ctx, &ch)) return 0; -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/8] nf_nat_snmp: sparse warning 2008-01-24 18:15 ` [PATCH 1/8] nf_nat_snmp: sparse warning Stephen Hemminger @ 2008-01-24 18:32 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:32 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > Use of 0 as NULL causes sparse complaint. > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Applied, thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/8] netfilter: get rid of sparse warning 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:15 ` Stephen Hemminger 2008-01-24 18:34 ` Patrick McHardy 2008-01-24 18:15 ` [PATCH 3/8] nf_conntrack: sparse warnings Stephen Hemminger ` (5 subsequent siblings) 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-log-sparse.patch --] [-- Type: text/plain, Size: 622 bytes --] Tell sparse about lock assumption here. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/net/netfilter/nf_log.c 2008-01-23 10:02:42.000000000 -0800 +++ b/net/netfilter/nf_log.c 2008-01-23 10:03:00.000000000 -0800 @@ -103,6 +103,7 @@ EXPORT_SYMBOL(nf_log_packet); #ifdef CONFIG_PROC_FS static void *seq_start(struct seq_file *seq, loff_t *pos) + __acquires(RCU) { rcu_read_lock(); @@ -123,6 +124,7 @@ static void *seq_next(struct seq_file *s } static void seq_stop(struct seq_file *s, void *v) + __releases(RCU) { rcu_read_unlock(); } -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 2/8] netfilter: get rid of sparse warning 2008-01-24 18:15 ` [PATCH 2/8] netfilter: get rid of " Stephen Hemminger @ 2008-01-24 18:34 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:34 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > Tell sparse about lock assumption here. Thanks, but I already have an identical patch queued from Eric Dumazet. Will send everything to Dave soon. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/8] nf_conntrack: sparse warnings 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:15 ` [PATCH 2/8] netfilter: get rid of " Stephen Hemminger @ 2008-01-24 18:15 ` Stephen Hemminger 2008-01-24 18:35 ` Patrick McHardy 2008-01-24 18:15 ` [PATCH 4/8] netfilter: more sparse warning fixes Stephen Hemminger ` (4 subsequent siblings) 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-hashtable.patch --] [-- Type: text/plain, Size: 2330 bytes --] The hashtable size is really unsigned so sparse complains when you pass a signed integer. Change all uses to make it consistent. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/include/net/netfilter/nf_conntrack.h 2008-01-23 10:24:42.000000000 -0800 +++ b/include/net/netfilter/nf_conntrack.h 2008-01-23 10:25:05.000000000 -0800 @@ -171,9 +171,9 @@ static inline void nf_ct_put(struct nf_c extern int nf_ct_l3proto_try_module_get(unsigned short l3proto); extern void nf_ct_l3proto_module_put(unsigned short l3proto); -extern struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced); +extern struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced); extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, - int size); + unsigned int size); extern struct nf_conntrack_tuple_hash * __nf_conntrack_find(const struct nf_conntrack_tuple *tuple, --- a/net/netfilter/nf_conntrack_core.c 2008-01-23 10:23:37.000000000 -0800 +++ b/net/netfilter/nf_conntrack_core.c 2008-01-23 10:26:48.000000000 -0800 @@ -939,7 +939,7 @@ static int kill_all(struct nf_conn *i, v return 1; } -void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, int size) +void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, unsigned int size) { if (vmalloced) vfree(hash); @@ -988,7 +988,7 @@ void nf_conntrack_cleanup(void) nf_conntrack_expect_fini(); } -struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced) +struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced) { struct hlist_head *hash; unsigned int size, i; @@ -1015,8 +1015,8 @@ EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable) int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp) { - int i, bucket, hashsize, vmalloced; - int old_vmalloced, old_size; + int i, bucket, vmalloced, old_vmalloced; + unsigned int hashsize, old_size; int rnd; struct hlist_head *hash, *old_hash; struct nf_conntrack_tuple_hash *h; @@ -1025,7 +1025,7 @@ int nf_conntrack_set_hashsize(const char if (!nf_conntrack_htable_size) return param_set_uint(val, kp); - hashsize = simple_strtol(val, NULL, 0); + hashsize = simple_strtoul(val, NULL, 0); if (!hashsize) return -EINVAL; -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/8] nf_conntrack: sparse warnings 2008-01-24 18:15 ` [PATCH 3/8] nf_conntrack: sparse warnings Stephen Hemminger @ 2008-01-24 18:35 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:35 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > The hashtable size is really unsigned so sparse complains when you pass > a signed integer. Change all uses to make it consistent. Applied, thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/8] netfilter: more sparse warning fixes 2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger ` (2 preceding siblings ...) 2008-01-24 18:15 ` [PATCH 3/8] nf_conntrack: sparse warnings Stephen Hemminger @ 2008-01-24 18:15 ` Stephen Hemminger 2008-01-24 18:40 ` Patrick McHardy 2008-01-24 18:15 ` [PATCH 5/8] conntrack: get rid of sparse warnings Stephen Hemminger ` (3 subsequent siblings) 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-queue-sparse.patch --] [-- Type: text/plain, Size: 1574 bytes --] Get rif of sparse warnings about variable overlap, and locking. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/net/netfilter/nfnetlink_log.c 2008-01-23 10:04:58.000000000 -0800 +++ b/net/netfilter/nfnetlink_log.c 2008-01-23 10:05:15.000000000 -0800 @@ -866,6 +866,7 @@ static struct hlist_node *get_idx(struct } static void *seq_start(struct seq_file *seq, loff_t *pos) + __acquires(instances_lock) { read_lock_bh(&instances_lock); return get_idx(seq->private, *pos); @@ -878,6 +879,7 @@ static void *seq_next(struct seq_file *s } static void seq_stop(struct seq_file *s, void *v) + __releases(instances_lock) { read_unlock_bh(&instances_lock); } --- a/net/netfilter/nfnetlink_queue.c 2008-01-23 10:04:00.000000000 -0800 +++ b/net/netfilter/nfnetlink_queue.c 2008-01-23 10:04:43.000000000 -0800 @@ -360,7 +360,7 @@ nfqnl_build_packet_message(struct nfqnl_ if (data_len) { struct nlattr *nla; - int size = nla_attr_size(data_len); + size = nla_attr_size(data_len); if (skb_tailroom(skb) < nla_total_size(data_len)) { printk(KERN_WARNING "nf_queue: no tailroom!\n"); @@ -845,6 +845,7 @@ static struct hlist_node *get_idx(struct } static void *seq_start(struct seq_file *seq, loff_t *pos) + __acquires(instances_lock) { spin_lock(&instances_lock); return get_idx(seq, *pos); @@ -857,6 +858,7 @@ static void *seq_next(struct seq_file *s } static void seq_stop(struct seq_file *s, void *v) + __releases(instances_lock) { spin_unlock(&instances_lock); } -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/8] netfilter: more sparse warning fixes 2008-01-24 18:15 ` [PATCH 4/8] netfilter: more sparse warning fixes Stephen Hemminger @ 2008-01-24 18:40 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:40 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > --- a/net/netfilter/nfnetlink_queue.c 2008-01-23 10:04:00.000000000 -0800 > +++ b/net/netfilter/nfnetlink_queue.c 2008-01-23 10:04:43.000000000 -0800 > @@ -360,7 +360,7 @@ nfqnl_build_packet_message(struct nfqnl_ > > if (data_len) { > struct nlattr *nla; > - int size = nla_attr_size(data_len); > + size = nla_attr_size(data_len); > > if (skb_tailroom(skb) < nla_total_size(data_len)) { > printk(KERN_WARNING "nf_queue: no tailroom!\n"); > @@ -845,6 +845,7 @@ static struct hlist_node *get_idx(struct > } > > static void *seq_start(struct seq_file *seq, loff_t *pos) > + __acquires(instances_lock) > { > spin_lock(&instances_lock); > return get_idx(seq, *pos); > @@ -857,6 +858,7 @@ static void *seq_next(struct seq_file *s > } > > static void seq_stop(struct seq_file *s, void *v) > + __releases(instances_lock) > { > spin_unlock(&instances_lock); > } I already have this part queued from Eric, but I've applied the nfnetlink_log part. Thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/8] conntrack: get rid of sparse warnings 2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger ` (3 preceding siblings ...) 2008-01-24 18:15 ` [PATCH 4/8] netfilter: more sparse warning fixes Stephen Hemminger @ 2008-01-24 18:15 ` Stephen Hemminger 2008-01-24 18:42 ` Patrick McHardy 2008-01-24 18:15 ` [PATCH 6/8] nf_conntrack-h323: sparse fixes Stephen Hemminger ` (2 subsequent siblings) 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- 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> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/8] conntrack: get rid of sparse warnings 2008-01-24 18:15 ` [PATCH 5/8] conntrack: get rid of sparse warnings Stephen Hemminger @ 2008-01-24 18:42 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:42 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > Teach sparse about locking here, and fix signed/unsigned warnings. Applied, thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/8] nf_conntrack-h323: sparse fixes 2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger ` (4 preceding siblings ...) 2008-01-24 18:15 ` [PATCH 5/8] conntrack: get rid of sparse warnings Stephen Hemminger @ 2008-01-24 18:15 ` 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:15 ` [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix Stephen Hemminger 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-conntrack-h323-sparse.patch --] [-- Type: text/plain, Size: 6123 bytes --] Sparse complains when a function is not really static. Putting static on the function prototype is not enough. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/net/netfilter/nf_conntrack_h323_asn1.c 2008-01-24 08:25:04.000000000 -0800 +++ b/net/netfilter/nf_conntrack_h323_asn1.c 2008-01-24 10:11:41.000000000 -0800 @@ -126,7 +126,7 @@ static int decode_choice(bitstr_t * bs, /* Decoder Functions Vector */ typedef int (*decoder_t) (bitstr_t *, field_t *, char *, int); -static decoder_t Decoders[] = { +static const decoder_t Decoders[] = { decode_nul, decode_bool, decode_oid, @@ -150,7 +150,7 @@ static decoder_t Decoders[] = { * Functions ****************************************************************************/ /* Assume bs is aligned && v < 16384 */ -unsigned get_len(bitstr_t * bs) +static unsigned get_len(bitstr_t * bs) { unsigned v; @@ -166,7 +166,7 @@ unsigned get_len(bitstr_t * bs) } /****************************************************************************/ -unsigned get_bit(bitstr_t * bs) +static unsigned get_bit(bitstr_t * bs) { unsigned b = (*bs->cur) & (0x80 >> bs->bit); @@ -177,7 +177,7 @@ unsigned get_bit(bitstr_t * bs) /****************************************************************************/ /* Assume b <= 8 */ -unsigned get_bits(bitstr_t * bs, unsigned b) +static unsigned get_bits(bitstr_t * bs, unsigned b) { unsigned v, l; @@ -203,7 +203,7 @@ unsigned get_bits(bitstr_t * bs, unsigne /****************************************************************************/ /* Assume b <= 32 */ -unsigned get_bitmap(bitstr_t * bs, unsigned b) +static unsigned get_bitmap(bitstr_t * bs, unsigned b) { unsigned v, l, shift, bytes; @@ -242,7 +242,7 @@ unsigned get_bitmap(bitstr_t * bs, unsig /**************************************************************************** * Assume bs is aligned and sizeof(unsigned int) == 4 ****************************************************************************/ -unsigned get_uint(bitstr_t * bs, int b) +static unsigned get_uint(bitstr_t * bs, int b) { unsigned v = 0; @@ -264,7 +264,7 @@ unsigned get_uint(bitstr_t * bs, int b) } /****************************************************************************/ -int decode_nul(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_nul(bitstr_t * bs, field_t * f, char *base, int level) { PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name); @@ -272,7 +272,7 @@ int decode_nul(bitstr_t * bs, field_t * } /****************************************************************************/ -int decode_bool(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_bool(bitstr_t * bs, field_t * f, char *base, int level) { PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name); @@ -283,7 +283,7 @@ int decode_bool(bitstr_t * bs, field_t * } /****************************************************************************/ -int decode_oid(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_oid(bitstr_t * bs, field_t * f, char *base, int level) { int len; @@ -299,7 +299,7 @@ int decode_oid(bitstr_t * bs, field_t * } /****************************************************************************/ -int decode_int(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_int(bitstr_t * bs, field_t * f, char *base, int level) { unsigned len; @@ -342,7 +342,7 @@ int decode_int(bitstr_t * bs, field_t * } /****************************************************************************/ -int decode_enum(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_enum(bitstr_t * bs, field_t * f, char *base, int level) { PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name); @@ -357,7 +357,7 @@ int decode_enum(bitstr_t * bs, field_t * } /****************************************************************************/ -int decode_bitstr(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_bitstr(bitstr_t * bs, field_t * f, char *base, int level) { unsigned len; @@ -390,7 +390,7 @@ int decode_bitstr(bitstr_t * bs, field_t } /****************************************************************************/ -int decode_numstr(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_numstr(bitstr_t * bs, field_t * f, char *base, int level) { unsigned len; @@ -407,7 +407,7 @@ int decode_numstr(bitstr_t * bs, field_t } /****************************************************************************/ -int decode_octstr(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_octstr(bitstr_t * bs, field_t * f, char *base, int level) { unsigned len; @@ -455,7 +455,7 @@ int decode_octstr(bitstr_t * bs, field_t } /****************************************************************************/ -int decode_bmpstr(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_bmpstr(bitstr_t * bs, field_t * f, char *base, int level) { unsigned len; @@ -480,7 +480,7 @@ int decode_bmpstr(bitstr_t * bs, field_t } /****************************************************************************/ -int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) { unsigned ext, bmp, i, opt, len = 0, bmp2, bmp2_len; int err; @@ -596,7 +596,7 @@ int decode_seq(bitstr_t * bs, field_t * } /****************************************************************************/ -int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level) { unsigned count, effective_count = 0, i, len = 0; int err; @@ -685,7 +685,7 @@ int decode_seqof(bitstr_t * bs, field_t /****************************************************************************/ -int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) +static int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) { unsigned type, ext, len = 0; int err; -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/8] nf_conntrack-h323: sparse fixes 2008-01-24 18:15 ` [PATCH 6/8] nf_conntrack-h323: sparse fixes Stephen Hemminger @ 2008-01-24 18:44 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:44 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > Sparse complains when a function is not really static. Putting static > on the function prototype is not enough. Applied, thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 7/8] netfilter: more spase fixes 2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger ` (5 preceding siblings ...) 2008-01-24 18:15 ` [PATCH 6/8] nf_conntrack-h323: sparse fixes Stephen Hemminger @ 2008-01-24 18:15 ` 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 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-yms.patch --] [-- Type: text/plain, Size: 1321 bytes --] Some lock annotations, and make initializers static. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/net/netfilter/xt_hashlimit.c 2008-01-24 10:10:46.000000000 -0800 +++ b/net/netfilter/xt_hashlimit.c 2008-01-24 10:12:30.000000000 -0800 @@ -624,6 +624,7 @@ static struct xt_match hashlimit_mt_reg[ /* PROC stuff */ static void *dl_seq_start(struct seq_file *s, loff_t *pos) + __acquires(htable->lock) { struct proc_dir_entry *pde = s->private; struct xt_hashlimit_htable *htable = pde->data; @@ -656,6 +657,7 @@ static void *dl_seq_next(struct seq_file } static void dl_seq_stop(struct seq_file *s, void *v) + __releases(htable->lock) { struct proc_dir_entry *pde = s->private; struct xt_hashlimit_htable *htable = pde->data; --- a/net/ipv4/netfilter/nf_nat_proto_gre.c 2008-01-24 10:10:46.000000000 -0800 +++ b/net/ipv4/netfilter/nf_nat_proto_gre.c 2008-01-24 10:12:30.000000000 -0800 @@ -148,12 +148,12 @@ static const struct nf_nat_protocol gre #endif }; -int __init nf_nat_proto_gre_init(void) +static int __init nf_nat_proto_gre_init(void) { return nf_nat_protocol_register(&gre); } -void __exit nf_nat_proto_gre_fini(void) +static void __exit nf_nat_proto_gre_fini(void) { nf_nat_protocol_unregister(&gre); } -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 7/8] netfilter: more spase fixes 2008-01-24 18:15 ` [PATCH 7/8] netfilter: more spase fixes Stephen Hemminger @ 2008-01-24 18:43 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:43 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > Some lock annotations, and make initializers static. Applied, thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix 2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger ` (6 preceding siblings ...) 2008-01-24 18:15 ` [PATCH 7/8] netfilter: more spase fixes Stephen Hemminger @ 2008-01-24 18:15 ` Stephen Hemminger 2008-01-24 18:45 ` Patrick McHardy 7 siblings, 1 reply; 20+ messages in thread From: Stephen Hemminger @ 2008-01-24 18:15 UTC (permalink / raw) To: Patrick McHardy; +Cc: netfilter-devel [-- Attachment #1: nf-ipv6.patch --] [-- Type: text/plain, Size: 887 bytes --] Comment out unused code, and include header so function prototypes are checked. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- a/net/ipv6/netfilter/nf_conntrack_reasm.c 2008-01-23 14:19:41.000000000 -0800 +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c 2008-01-23 14:23:39.000000000 -0800 @@ -42,6 +42,7 @@ #include <linux/sysctl.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv6.h> +#include <net/netfilter/ipv6/nf_conntrack_ipv6.h> #include <linux/kernel.h> #include <linux/module.h> @@ -680,6 +681,7 @@ void nf_ct_frag6_output(unsigned int hoo nf_conntrack_put_reasm(skb); } +#ifdef notused int nf_ct_frag6_kfree_frags(struct sk_buff *skb) { struct sk_buff *s, *s2; @@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu return 0; } +#endif int nf_ct_frag6_init(void) { -- Stephen Hemminger <stephen.hemminger@vyatta.com> ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix 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 0 siblings, 1 reply; 20+ messages in thread From: Patrick McHardy @ 2008-01-24 18:45 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netfilter-devel Stephen Hemminger wrote: > +#ifdef notused > int nf_ct_frag6_kfree_frags(struct sk_buff *skb) > { > struct sk_buff *s, *s2; > @@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu > > return 0; > } > +#endif I'm wondering whether this is correct. I'm on the way out the door though, I'll look into it later. Thanks Stephen. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix 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> 0 siblings, 2 replies; 20+ messages in thread From: Yasuyuki KOZAKAI @ 2008-01-25 1:24 UTC (permalink / raw) To: kaber; +Cc: shemminger, netfilter-devel From: Patrick McHardy <kaber@trash.net> Date: Thu, 24 Jan 2008 19:45:42 +0100 > Stephen Hemminger wrote: > > > +#ifdef notused > > int nf_ct_frag6_kfree_frags(struct sk_buff *skb) > > { > > struct sk_buff *s, *s2; > > @@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu > > > > return 0; > > } > > +#endif > > I'm wondering whether this is correct. I'm on the way out the > door though, I'll look into it later. Thanks Stephen. I'll check it, too. At least linux 2.6.15 (which is the first release for nf_contrack) does not use the function. I try to recall the reason. -- kozakai ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix 2008-01-25 1:24 ` Yasuyuki KOZAKAI @ 2008-01-28 2:50 ` Yasuyuki KOZAKAI [not found] ` <200801280250.m0S2oWF1019241@toshiba.co.jp> 1 sibling, 0 replies; 20+ messages in thread From: Yasuyuki KOZAKAI @ 2008-01-28 2:50 UTC (permalink / raw) To: yasuyuki.kozakai; +Cc: kaber, shemminger, netfilter-devel From: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp> Date: Fri, 25 Jan 2008 10:24:10 +0900 (JST) > From: Patrick McHardy <kaber@trash.net> > Date: Thu, 24 Jan 2008 19:45:42 +0100 > > > Stephen Hemminger wrote: > > > > > +#ifdef notused > > > int nf_ct_frag6_kfree_frags(struct sk_buff *skb) > > > { > > > struct sk_buff *s, *s2; > > > @@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu > > > > > > return 0; > > > } > > > +#endif > > > > I'm wondering whether this is correct. I'm on the way out the > > door though, I'll look into it later. Thanks Stephen. > > I'll check it, too. At least linux 2.6.15 (which is the first release > for nf_contrack) does not use the function. I try to recall the reason. I agree to remove the function. I seemed to forget to remove it when implementing nf_conntrack based on ip6_conntrack. The later used it to free the reassembled skb packet the original fragments on fail of tracking. But the function became unnecessary as result of changing data structure so that packets could be reassembled at new hook - NF_IP6_PRI_CONNTRACK_DEFRAG. Regards, -- Yasuyuki Kozakai ^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <200801280250.m0S2oWF1019241@toshiba.co.jp>]
* Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix [not found] ` <200801280250.m0S2oWF1019241@toshiba.co.jp> @ 2008-01-29 12:54 ` Patrick McHardy 0 siblings, 0 replies; 20+ messages in thread From: Patrick McHardy @ 2008-01-29 12:54 UTC (permalink / raw) To: Yasuyuki KOZAKAI; +Cc: shemminger, netfilter-devel Yasuyuki KOZAKAI wrote: > From: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp> > Date: Fri, 25 Jan 2008 10:24:10 +0900 (JST) > >> From: Patrick McHardy <kaber@trash.net> >> Date: Thu, 24 Jan 2008 19:45:42 +0100 >> >>> Stephen Hemminger wrote: >>> >>> > +#ifdef notused >>> > int nf_ct_frag6_kfree_frags(struct sk_buff *skb) >>> > { >>> > struct sk_buff *s, *s2; >>> > @@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu >>> > >>> > return 0; >>> > } >>> > +#endif >>> >>> I'm wondering whether this is correct. I'm on the way out the >>> door though, I'll look into it later. Thanks Stephen. >> I'll check it, too. At least linux 2.6.15 (which is the first release >> for nf_contrack) does not use the function. I try to recall the reason. > > I agree to remove the function. > > I seemed to forget to remove it when implementing nf_conntrack based on > ip6_conntrack. The later used it to free the reassembled skb packet the > original fragments on fail of tracking. But the function became unnecessary > as result of changing data structure so that packets could be reassembled > at new hook - NF_IP6_PRI_CONNTRACK_DEFRAG. Thanks, I've added the missing include and removed this function. ^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2008-01-29 13:10 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 5/8] conntrack: get rid of sparse warnings Stephen Hemminger
2008-01-24 18:42 ` 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).