[NETFILTER]: ctnetlink: Fix dumping of helper name
authorPatrick McHardy <kaber@trash.net>
Thu, 5 Jan 2006 20:20:02 +0000 (12:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Jan 2006 20:20:02 +0000 (12:20 -0800)
Properly dump the helper name instead of internal kernel data.
Based on patch by Marcus Sundberg <marcus@ingate.com>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netfilter/nfnetlink_conntrack.h
net/ipv4/netfilter/ip_conntrack_netlink.c

index b8e9a5b6fb1e5294cbef4bc49a0f7b3ecd51b000..668ec946c8e24d47f53d71290e566de54dbc250a 100644 (file)
@@ -131,6 +131,4 @@ enum ctattr_help {
 };
 #define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
 
-#define CTA_HELP_MAXNAMESIZE   32
-
 #endif /* _IPCONNTRACK_NETLINK_H */
index 703f2d2e3464075f6df809ee85e77bb336fe24f2..c9ebbe0d2d9cc6ad8bca99b0b3f94ab699695d52 100644 (file)
@@ -161,7 +161,7 @@ ctnetlink_dump_helpinfo(struct sk_buff *skb, const struct ip_conntrack *ct)
                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);