* [NETFILTER 2/3]: Fix HW checksum handling in ECN target
@ 2005-08-20 1:40 Patrick McHardy
0 siblings, 0 replies; only message in thread
From: Patrick McHardy @ 2005-08-20 1:40 UTC (permalink / raw)
To: David S. Miller; +Cc: Netfilter Development Mailinglist
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: 02-2.6.13.diff --]
[-- Type: text/x-patch, Size: 1442 bytes --]
[NETFILTER]: Fix HW checksum handling in ECN target
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit b477e1c6defc1b0e1181350908714e11de5768dd
tree c30a6471018a9d8c91cfdcfdf829021428de4842
parent 0fdd261fea7da690726451e22e72845d2bcce50f
author Patrick McHardy <kaber@trash.net> Sat, 20 Aug 2005 03:34:53 +0200
committer Patrick McHardy <kaber@trash.net> Sat, 20 Aug 2005 03:34:53 +0200
net/ipv4/netfilter/ipt_ECN.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -71,6 +71,10 @@ set_ect_tcp(struct sk_buff **pskb, const
return 0;
tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;
+ if ((*pskb)->ip_summed == CHECKSUM_HW &&
+ skb_checksum_help(*pskb, inward))
+ return 0;
+
diffs[0] = ((u_int16_t *)tcph)[6];
if (einfo->operation & IPT_ECN_OP_SET_ECE)
tcph->ece = einfo->proto.tcp.ece;
@@ -79,13 +83,10 @@ set_ect_tcp(struct sk_buff **pskb, const
diffs[1] = ((u_int16_t *)tcph)[6];
diffs[0] = diffs[0] ^ 0xFFFF;
- if ((*pskb)->ip_summed != CHECKSUM_HW)
+ if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY)
tcph->check = csum_fold(csum_partial((char *)diffs,
sizeof(diffs),
tcph->check^0xFFFF));
- else
- if (skb_checksum_help(*pskb, inward))
- return 0;
(*pskb)->nfcache |= NFC_ALTERED;
return 1;
}
[-- Attachment #3: 02-2.6.14.diff --]
[-- Type: text/x-patch, Size: 1409 bytes --]
[NETFILTER]: Fix HW checksum handling in ECN target
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit f1929b1a15a9a7d9761b344d3522698bd656154e
tree d2da13822149bfa1c49a8ae82930d4795f08f69f
parent a811712706846bff6ad796394ce4aa3abcc657b0
author Patrick McHardy <kaber@trash.net> Sat, 20 Aug 2005 03:28:22 +0200
committer Patrick McHardy <kaber@trash.net> Sat, 20 Aug 2005 03:28:22 +0200
net/ipv4/netfilter/ipt_ECN.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -70,6 +70,10 @@ set_ect_tcp(struct sk_buff **pskb, const
return 0;
tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;
+ if ((*pskb)->ip_summed == CHECKSUM_HW &&
+ skb_checksum_help(*pskb, inward))
+ return 0;
+
diffs[0] = ((u_int16_t *)tcph)[6];
if (einfo->operation & IPT_ECN_OP_SET_ECE)
tcph->ece = einfo->proto.tcp.ece;
@@ -78,13 +82,10 @@ set_ect_tcp(struct sk_buff **pskb, const
diffs[1] = ((u_int16_t *)tcph)[6];
diffs[0] = diffs[0] ^ 0xFFFF;
- if ((*pskb)->ip_summed != CHECKSUM_HW)
+ if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY)
tcph->check = csum_fold(csum_partial((char *)diffs,
sizeof(diffs),
tcph->check^0xFFFF));
- else
- if (skb_checksum_help(*pskb, inward))
- return 0;
return 1;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-20 1:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-20 1:40 [NETFILTER 2/3]: Fix HW checksum handling in ECN target 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.