All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ctnetlink: Fix dumping of helper name.
@ 2005-12-27 13:36 Marcus Sundberg
  2005-12-27 13:46 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Marcus Sundberg @ 2005-12-27 13:36 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Harald Welte, Patrick McHardy

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

Hi,

this patch fixes ctnetlink dumping of the helper name.

//Marcus
-- 
---------------------------------------+--------------------------
   Marcus Sundberg <marcus@ingate.com>  | Firewalls with SIP & NAT
  Software Developer, Ingate Systems AB |  http://www.ingate.com/

[-- Attachment #2: ctnetlink-dump_helpinfo.diff --]
[-- Type: text/x-patch, Size: 666 bytes --]

[NETFILTER] ctnetlink: Fix dumping of helper name.

Properly dump the helper name instead of internal kernel data.

Signed-off-by: Marcus Sundberg <marcus@ingate.com>

--- linux-2.6.15-rc7/net/ipv4/netfilter/ip_conntrack_netlink.c	2005/12/27 13:21:52	1.1
+++ linux-2.6.15-rc7/net/ipv4/netfilter/ip_conntrack_netlink.c	2005/12/27 13:21:54
@@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ctnetlink: Fix dumping of helper name.
  2005-12-27 13:36 [PATCH] ctnetlink: Fix dumping of helper name Marcus Sundberg
@ 2005-12-27 13:46 ` Pablo Neira Ayuso
  2006-01-03 12:48   ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2005-12-27 13:46 UTC (permalink / raw)
  To: Marcus Sundberg; +Cc: Harald Welte, netfilter-devel, Patrick McHardy

Marcus Sundberg wrote:
> 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.

-- 
Pablo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ctnetlink: Fix dumping of helper name.
  2005-12-27 13:46 ` Pablo Neira Ayuso
@ 2006-01-03 12:48   ` Patrick McHardy
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2006-01-03 12:48 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Harald Welte, netfilter-devel, Marcus Sundberg

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

Pablo Neira Ayuso wrote:
> Marcus Sundberg wrote:
> 
>>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.

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

Thanks for the information.

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1640 bytes --]

[NETFILTER]: ctnetlink: Fix dumping of helper name

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>

---
commit 327321f46f976c5392990351e318ea17255d5abe
tree 1cddbb78a4a9c565d4ee23c8b95e5acff78ca853
parent a728f5f4607dde215e48f7415d9209e450f434f0
author Patrick McHardy <kaber@trash.net> Tue, 03 Jan 2006 13:45:53 +0100
committer Patrick McHardy <kaber@trash.net> 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(-)

diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index b8e9a5b..668ec94 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -131,6 +131,4 @@ enum ctattr_help {
 };
 #define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
 
-#define CTA_HELP_MAXNAMESIZE	32
-
 #endif /* _IPCONNTRACK_NETLINK_H */
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index 91fe8f2..b1c3eca 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-03 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-27 13:36 [PATCH] ctnetlink: Fix dumping of helper name Marcus Sundberg
2005-12-27 13:46 ` Pablo Neira Ayuso
2006-01-03 12:48   ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.