All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: ECN target corrupts packets (2.6 only)
@ 2005-01-02 11:17 Rusty Russell
  2005-01-02 15:07 ` Maciej Soltysiak
  0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2005-01-02 11:17 UTC (permalink / raw)
  To: Netfilter development mailing list; +Cc: Andrew Morton, Linus Torvalds

Name: ipt_ECN corrupt checksum fix
Status: Tested under nfsim
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Nasty bug, caught while writing the ECN target test.  Corrupts
checksums of packets when target is used on them.

Let this be a warning on the evils of casts.

Index: linux-2.6.10-bk1-Netfilter/net/ipv4/netfilter/ipt_ECN.c
===================================================================
--- linux-2.6.10-bk1-Netfilter.orig/net/ipv4/netfilter/ipt_ECN.c	2005-01-02 21:47:31.439866944 +1100
+++ linux-2.6.10-bk1-Netfilter/net/ipv4/netfilter/ipt_ECN.c	2005-01-02 21:56:47.396348712 +1100
@@ -67,7 +67,7 @@
 
 	if (einfo->operation & IPT_ECN_OP_SET_CWR)
 		th->cwr = einfo->proto.tcp.cwr;
-	diffs[1] = ((u_int16_t *)&th)[6];
+	diffs[1] = ((u_int16_t *)th)[6];
 
 	/* Only mangle if it's changed. */
 	if (diffs[0] != diffs[1]) {

-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman

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

end of thread, other threads:[~2005-01-03 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-02 11:17 [PATCH] netfilter: ECN target corrupts packets (2.6 only) Rusty Russell
2005-01-02 15:07 ` Maciej Soltysiak
2005-01-02 21:04   ` Patrick McHardy
2005-01-03 10:15     ` Rusty Russell

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.