[PATCH 2/3] Fix partial csum tx handling

Mark McLoughlin
2008-05-27T11:36:12Z

Older kernels didn't have the csum_start/csum_offset
skb members, but skb->csum did contain the offset into
the transport header of the csum field and csum->h
contained a pointer to the transport layer header.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
---
hack-module.awk | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hack-module.awk b/hack-module.awk
index b687951..d04c3b6 100644
--- a/hack-module.awk
+++ b/hack-module.awk
@@ -124,10 +124,17 @@

/ip_summed == CHECKSUM_PARTIAL\)/ {
print "#ifdef COMPAT_csum_offset";
- print "\thdr->flags = 0;"
- print "\thdr->csum_offset = hdr->csum_start = 0;"
+ print "\tif (skb->ip_summed == CHECKSUM_HW) {"
print "#else"
- need_endif_indent_brace = 1;
+ need_endif = 1;
+}
+
+/hdr->csum_start = skb->csum_start/ {
+ print "#ifdef COMPAT_csum_offset";
+ print "\t\thdr->csum_start = skb->h.raw - skb->data;";
+ print "\t\thdr->csum_offset = skb->csum;";
+ print "#else"
+ need_endif = 1;
}

/skb_transport_header/ {
--
1.5.5.1