Commit a89d6351 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] ipt_ECN corrupt checksum fix

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.
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2e20fb91
...@@ -67,7 +67,7 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) ...@@ -67,7 +67,7 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward)
if (einfo->operation & IPT_ECN_OP_SET_CWR) if (einfo->operation & IPT_ECN_OP_SET_CWR)
th->cwr = einfo->proto.tcp.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. */ /* Only mangle if it's changed. */
if (diffs[0] != diffs[1]) { if (diffs[0] != diffs[1]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment