Skip to contentSkip to conversation

trivial patches to netfilter for net-2.6.25

PATCH Applied Stephen Hemminger 3 participants 20 messages Jan 24, 2008 – Jan 29, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover trivial patches to netfilter for net-2.6.25

Doing a bunch of sparse cleanups to try and get rid of most of the warnings in networking code.

Signature · 1 line
Stephen Hemminger <[email protected]>
#1 lore raw

PATCH 1/8 nf_nat_snmp: sparse warning

Use of 0 as NULL causes sparse complaint.

net/ipv4/netfilter/nf_nat_snmp_basic.c +1 -1
@@ -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;
 
Signature · 1 line
Stephen Hemminger <[email protected]>
#3 lore raw

PATCH 2/8 netfilter: get rid of sparse warning

In reply to Stephen Hemminger

Tell sparse about lock assumption here.

net/netfilter/nf_log.c +2 -0
@@ -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();
 }
Signature · 1 line
Stephen Hemminger <[email protected]>
#4 lore raw

Re: [PATCH 2/8] netfilter: get rid of sparse warning

Quoted 1 line · Stephen Hemminger

Tell sparse about lock assumption here.

Thanks, but I already have an identical patch queued from Eric Dumazet. Will send everything to Dave soon.

#5 lore raw

PATCH 3/8 nf_conntrack: sparse warnings

In reply to Stephen Hemminger

The hashtable size is really unsigned so sparse complains when you pass a signed integer. Change all uses to make it consistent.

include/net/netfilter/nf_conntrack.h +2 -2
@@ -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,
net/netfilter/nf_conntrack_core.c +5 -5
@@ -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;
 
Signature · 1 line
Stephen Hemminger <[email protected]>
#6 lore raw

Re: [PATCH 3/8] nf_conntrack: sparse warnings

Quoted 2 lines · Stephen Hemminger

The hashtable size is really unsigned so sparse complains when you pass a signed integer. Change all uses to make it consistent.

Applied, thanks.

#7 lore raw

PATCH 4/8 netfilter: more sparse warning fixes

In reply to Stephen Hemminger

Get rif of sparse warnings about variable overlap, and locking.

net/netfilter/nfnetlink_log.c +2 -0
@@ -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);
 }
net/netfilter/nfnetlink_queue.c +3 -1
@@ -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);
 }
Signature · 1 line
Stephen Hemminger <[email protected]>
#8 lore raw

Re: [PATCH 4/8] netfilter: more sparse warning fixes

Quoted 20 lines · Stephen Hemminger
net/netfilter/nfnetlink_queue.c +2 -1
@@ -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);

net/netfilter/nfnetlink_queue.c static void *seq_next(struct seq_file *s · line 864

Quoted 7 lines
net/netfilter/nfnetlink_queue.c +1 -0
@@ -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.

#9 lore raw

PATCH 5/8 conntrack: get rid of sparse warnings

In reply to Stephen Hemminger

Teach sparse about locking here, and fix signed/unsigned warnings.

net/netfilter/nf_conntrack_standalone.c +2 -0
@@ -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);
 }
net/netfilter/nf_conntrack_expect.c +2 -0
@@ -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);
 }
net/netfilter/nf_conntrack_irc.c +1 -1
@@ -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 */
net/netfilter/nf_conntrack_proto_sctp.c +2 -2
@@ -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);
net/netfilter/nf_conntrack_proto_tcp.c +3 -3
@@ -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;
 
net/netfilter/nf_conntrack_sip.c +2 -2
@@ -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;
net/netfilter/nf_conntrack_tftp.c +1 -1
@@ -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");
 
Signature · 1 line
Stephen Hemminger <[email protected]>
#10 lore raw

Re: [PATCH 5/8] conntrack: get rid of sparse warnings

Quoted 1 line · Stephen Hemminger

Teach sparse about locking here, and fix signed/unsigned warnings.

Applied, thanks.

#11 lore raw

PATCH 6/8 nf_conntrack-h323: sparse fixes

In reply to Stephen Hemminger

Sparse complains when a function is not really static. Putting static on the function prototype is not enough.

net/netfilter/nf_conntrack_h323_asn1.c +18 -18
@@ -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;
Signature · 1 line
Stephen Hemminger <[email protected]>
#12 lore raw

Re: [PATCH 6/8] nf_conntrack-h323: sparse fixes

Quoted 2 lines · Stephen Hemminger

Sparse complains when a function is not really static. Putting static on the function prototype is not enough.

Applied, thanks.

#13 lore raw

PATCH 7/8 netfilter: more spase fixes

In reply to Stephen Hemminger

Some lock annotations, and make initializers static.

net/netfilter/xt_hashlimit.c +2 -0
@@ -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;
net/ipv4/netfilter/nf_nat_proto_gre.c +2 -2
@@ -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);
 }
Signature · 1 line
Stephen Hemminger <[email protected]>
#14 lore raw

Re: [PATCH 7/8] netfilter: more spase fixes

Quoted 1 line · Stephen Hemminger

Some lock annotations, and make initializers static.

Applied, thanks.

#15 lore raw

PATCH 8/8 nf_conntrack ipv6: unused code and sparse fix

In reply to Stephen Hemminger

Comment out unused code, and include header so function prototypes are checked.

net/ipv6/netfilter/nf_conntrack_reasm.c +3 -0
@@ -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)
 {
Signature · 1 line
Stephen Hemminger <[email protected]>
#16 lore raw

Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix

net/ipv6/netfilter/nf_conntrack_reasm.c int nf_ct_frag6_kfree_frags(struct sk_bu · line 699

Quoted 9 lines · Stephen Hemminger

+#ifdef notused
int nf_ct_frag6_kfree_frags(struct sk_buff *skb)

{
	struct sk_buff *s, *s2;
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -0
@@ -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.

#17 lore raw

Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix

From: Patrick McHardy <[email protected]>
Date: Thu, 24 Jan 2008 19:45:42 +0100

Quoted 8 lines
Quoted 6 lines · Stephen Hemminger

+#ifdef notused
int nf_ct_frag6_kfree_frags(struct sk_buff *skb)

{
	struct sk_buff *s, *s2;
(quoted diff) +0 -0
@@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu
 
Quoted 6 lines

net/ipv6/netfilter/nf_conntrack_reasm.c int nf_ct_frag6_kfree_frags(struct sk_bu · line 699

Quoted 3 lines
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -0
 	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

#18 lore raw

Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix

From: Yasuyuki KOZAKAI <[email protected]>
Date: Fri, 25 Jan 2008 10:24:10 +0900 (JST)

Quoted 15 lines

From: Patrick McHardy <[email protected]>
Date: Thu, 24 Jan 2008 19:45:42 +0100

Quoted 12 lines
Quoted 9 lines · Stephen Hemminger

+#ifdef notused
int nf_ct_frag6_kfree_frags(struct sk_buff *skb)

{
	struct sk_buff *s, *s2;
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -0
@@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu
 
 	return 0;
 }
+#endif
Quoted 5 lines
Quoted 2 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#20 lore raw

Re: [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix

Quoted 23 lines · Yasuyuki KOZAKAI

From: Yasuyuki KOZAKAI <[email protected]>
Date: Fri, 25 Jan 2008 10:24:10 +0900 (JST)

Quoted 11 lines

From: Patrick McHardy <[email protected]>
Date: Thu, 24 Jan 2008 19:45:42 +0100

Quoted 8 lines
Quoted 6 lines · Stephen Hemminger

+#ifdef notused
int nf_ct_frag6_kfree_frags(struct sk_buff *skb)

{
	struct sk_buff *s, *s2;
(quoted diff) +0 -0
@@ -694,6 +696,7 @@ int nf_ct_frag6_kfree_frags(struct sk_bu
 
Quoted 8 lines
Quoted 6 lines

net/ipv6/netfilter/nf_conntrack_reasm.c int nf_ct_frag6_kfree_frags(struct sk_bu · line 699

Quoted 3 lines
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -0
 	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.

Quoted 7 lines

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.