Skip to contentSkip to conversation

Fix compilation with debugging enabled

CTNETLINK Pablo Neira Ayuso 2 participants 3 messages Oct 10, 2006

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

Two debugging messages inside dump_table refer to variable `id' that is not declared anymore.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[CTNETLINK] Fix compilation with debugging enabled

two debugging messages inside dump_table refer to variable `id' that is not declared anymore.

net/ipv4/netfilter/ip_conntrack_netlink.c +2 -3
Index: net-2.6/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
@@ -411,8 +411,7 @@ ctnetlink_dump_table(struct sk_buff *skb
 	struct ip_conntrack_tuple_hash *h;
 	struct list_head *i;
 
-	DEBUGP("entered %s, last bucket=%lu id=%u\n", __FUNCTION__, 
-			cb->args[0], *id);
+	DEBUGP("entered %s, last bucket=%lu\n", __FUNCTION__, cb->args[0]);
 
 	read_lock_bh(&ip_conntrack_lock);
 	last = (struct ip_conntrack *)cb->args[1];
@@ -452,7 +451,7 @@ out:
 	if (last)
 		ip_conntrack_put(last);
 
-	DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id);
+	DEBUGP("leaving, last bucket=%lu\n", cb->args[0]);
 	return skb->len;
 }
 
net/netfilter/nf_conntrack_netlink.c +2 -3
Index: net-2.6/net/netfilter/nf_conntrack_netlink.c
===================================================================
@@ -425,8 +425,7 @@ ctnetlink_dump_table(struct sk_buff *skb
 	struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh);
 	u_int8_t l3proto = nfmsg->nfgen_family;
 
-	DEBUGP("entered %s, last bucket=%lu id=%u\n", __FUNCTION__, 
-			cb->args[0], *id);
+	DEBUGP("entered %s, last bucket=%lu\n", __FUNCTION__, cb->args[0]);
 
 	read_lock_bh(&nf_conntrack_lock);
 	last = (struct nf_conn *)cb->args[1];
@@ -471,7 +470,7 @@ out:
 	if (last)
 		nf_ct_put(last);
 
-	DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id);
+	DEBUGP("leaving, last bucket=%lu\n", cb->args[0]);
 	return skb->len;
 }
 
#1 lore raw
Quoted 2 lines · Pablo Neira Ayuso

Two debugging messages inside dump_table refer to variable `id' that is not declared anymore.

Are you actually using the debugging stuff? Most of the ctnetlink debugging looks like a leftover from early development, so unless you think its still useful, I would prefer to remove it entirely since it makes the code less readable IMO.

author maintainer
#2 lore raw
Quoted 8 lines · Patrick McHardy
Quoted 2 lines · Pablo Neira Ayuso

Two debugging messages inside dump_table refer to variable `id' that is not declared anymore.

Are you actually using the debugging stuff? Most of the ctnetlink debugging looks like a leftover from early development, so unless you think its still useful, I would prefer to remove it entirely since it makes the code less readable IMO.

Agreed, I'll cook a patch to remove it

Signature · 1 line
The dawn of the fourth age of Linux firewalling is coming; a time of great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris