Skip to contentSkip to conversation

ctnetlink: Fix dumping of helper name.

PATCH In review Marcus Sundberg 3 participants 3 messages Dec 27, 2005 – Jan 3, 2006

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

PATCH 1/1 ctnetlink: Fix dumping of helper name.

Hi,

this patch fixes ctnetlink dumping of the helper name.

//Marcus

Signature · 3 lines
---------------------------------------+--------------------------
  Marcus Sundberg <[email protected]>  | Firewalls with SIP & NAT
 Software Developer, Ingate Systems AB |  http://www.ingate.com/

[NETFILTER] ctnetlink: Fix dumping of helper name.

Properly dump the helper name instead of internal kernel data.

net/ipv4/netfilter/ip_conntrack_netlink.c +1 -1
@@ -160,7 +160,7 @@ ctnetlink_dump_helpinfo(struct sk_buff *
 		return 0;
 		
 	nest_helper = NFA_NEST(skb, CTA_HELP);
-	NFA_PUT(skb, CTA_HELP_NAME, CTA_HELP_MAXNAMESIZE, &ct->helper->name);
+	NFA_PUT(skb, CTA_HELP_NAME, CTA_HELP_MAXNAMESIZE, ct->helper->name);
 
 	if (ct->helper->to_nfattr)
 		ct->helper->to_nfattr(skb, ct);
#1 lore raw
Quoted 1 line · Marcus Sundberg

this patch fixes ctnetlink dumping of the helper name.

It looks fine. Thanks Marcus.

@Patrick: JFYI, this bug doesn't affect nf_conntrack_netlink, so we don't need a patch for it.

Signature · 1 line
Pablo
#2 lore raw
Quoted 3 lines · Pablo Neira Ayuso
Quoted 1 line · Marcus Sundberg

this patch fixes ctnetlink dumping of the helper name.

I changed it to dump the same way as nf_conntrack_netlink instead, without the unneccessary length limitation. Not that it actually matters with realistic helper names but I'd like both to be compatible.

Quoted 2 lines

@Patrick: JFYI, this bug doesn't affect nf_conntrack_netlink, so we don't need a patch for it.

Thanks for the information.

[NETFILTER]: ctnetlink: Fix dumping of helper name

Properly dump the helper name instead of internal kernel data. Based on patch by Marcus Sundberg <[email protected]>.

---
commit 327321f46f976c5392990351e318ea17255d5abe
tree 1cddbb78a4a9c565d4ee23c8b95e5acff78ca853
parent a728f5f4607dde215e48f7415d9209e450f434f0
author Patrick McHardy <[email protected]> Tue, 03 Jan 2006 13:45:53 +0100 committer Patrick McHardy <[email protected]> Tue, 03 Jan 2006 13:45:53 +0100

 include/linux/netfilter/nfnetlink_conntrack.h |    2 --
 net/ipv4/netfilter/ip_conntrack_netlink.c     |    2 +-
 2 files changed, 1 insertions(+), 3 deletions(-)
include/linux/netfilter/nfnetlink_conntrack.h +0 -2
index b8e9a5b..668ec94 100644
@@ -131,6 +131,4 @@ enum ctattr_help {
 };
 #define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
 
-#define CTA_HELP_MAXNAMESIZE	32
-
 #endif /* _IPCONNTRACK_NETLINK_H */
net/ipv4/netfilter/ip_conntrack_netlink.c +1 -1
index 91fe8f2..b1c3eca 100644
@@ -160,7 +160,7 @@ ctnetlink_dump_helpinfo(struct sk_buff *
 		return 0;
 		
 	nest_helper = NFA_NEST(skb, CTA_HELP);
-	NFA_PUT(skb, CTA_HELP_NAME, CTA_HELP_MAXNAMESIZE, &ct->helper->name);
+	NFA_PUT(skb, CTA_HELP_NAME, strlen(ct->helper->name), ct->helper->name);
 
 	if (ct->helper->to_nfattr)
 		ct->helper->to_nfattr(skb, ct);