All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix icmp_id setter and doc
@ 2007-03-16 19:15 Phil Dibowitz
  2007-03-17 10:58 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Dibowitz @ 2007-03-16 19:15 UTC (permalink / raw)
  To: netfilter-devel


[-- Attachment #1.1: Type: text/plain, Size: 645 bytes --]

ICMP ID is stored as a u_int16_t, but its setter function derefs it's
arguement as a u_int8_t. Additionally the api "doc" claims it's a u8, when
it's not.

This patch fixes both.

-- 
Phil Dibowitz                             phil@ipom.com
Open Source software and tech docs        Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming


[-- Attachment #1.2: libnetfilter_conntrack-0.0.50_icmp_id.patch --]
[-- Type: text/x-diff, Size: 1086 bytes --]

--- libnetfilter_conntrack-0.0.50/include/libnetfilter_conntrack/libnetfilter_conntrack.h.orig	2007-03-16 12:07:40.000000000 -0700
+++ libnetfilter_conntrack-0.0.50/include/libnetfilter_conntrack/libnetfilter_conntrack.h	2007-03-16 12:08:25.000000000 -0700
@@ -359,7 +359,7 @@
 	ATTR_REPL_PORT_DST,		/* u16 bits */
 	ATTR_ICMP_TYPE = 12,		/* u8 bits */
 	ATTR_ICMP_CODE,			/* u8 bits */
-	ATTR_ICMP_ID,			/* u8 bits */
+	ATTR_ICMP_ID,			/* u16 bits */
 	ATTR_ORIG_L3PROTO,		/* u8 bits */
 	ATTR_REPL_L3PROTO = 16,		/* u8 bits */
 	ATTR_ORIG_L4PROTO,		/* u8 bits */
--- libnetfilter_conntrack-0.0.50/src/conntrack/setter.c.orig	2007-03-16 12:08:52.000000000 -0700
+++ libnetfilter_conntrack-0.0.50/src/conntrack/setter.c	2007-03-16 12:09:00.000000000 -0700
@@ -79,7 +79,7 @@
 
 static void set_attr_icmp_id(struct nf_conntrack *ct, const void *value)
 {
-	ct->tuple[__DIR_ORIG].l4src.icmp.id = *((u_int8_t *) value);
+	ct->tuple[__DIR_ORIG].l4src.icmp.id = *((u_int16_t *) value);
 }
 
 static void set_attr_orig_l3proto(struct nf_conntrack *ct, const void *value)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] Fix icmp_id setter and doc
  2007-03-16 19:15 [PATCH] Fix icmp_id setter and doc Phil Dibowitz
@ 2007-03-17 10:58 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2007-03-17 10:58 UTC (permalink / raw)
  To: Phil Dibowitz; +Cc: netfilter-devel

Phil Dibowitz wrote:
> ICMP ID is stored as a u_int16_t, but its setter function derefs it's
> arguement as a u_int8_t. Additionally the api "doc" claims it's a u8, when
> it's not.

Applied, thanks.

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

end of thread, other threads:[~2007-03-17 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-16 19:15 [PATCH] Fix icmp_id setter and doc Phil Dibowitz
2007-03-17 10:58 ` 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.