>From 22b2b6c7b480bc712f93e48816675d88162b8963 Mon Sep 17 00:00:00 2001
From: Dor Laor <dor.laor@qumranet.com>
Date: Wed, 5 Mar 2008 16:40:29 +0200
Subject: [PATCH 2/3] Move COMPAT_csum_offset to kernels < .24 Also add #else for initializing the virtio_net_hdr

Signed-off-by: Dor Laor <dor.laor@qumranet.com>
---
 external-module-compat.h |    4 ++--
 hack-module.awk          |    5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/external-module-compat.h b/external-module-compat.h
index 75c4fd0..9c93464 100644
--- a/external-module-compat.h
+++ b/external-module-compat.h
@@ -63,6 +63,8 @@ do {							\
 } while(0)
 #define netif_rx_schedule(dev, napi) netif_rx_schedule(dev)
 
+#define COMPAT_csum_offset
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
 
 #define scsi_cmd_ioctl(filp, rq, gendisk, cmd, data) \
@@ -85,8 +87,6 @@ do {							\
 #define list_first_entry(ptr, type, member) \
 	list_entry((ptr)->next, type, member)
 
-#define COMPAT_csum_offset
-
 static inline void * __must_check krealloc(const void *data, size_t size,
 					   gfp_t gfp)
 {
diff --git a/hack-module.awk b/hack-module.awk
index bd63fb9..41ba60d 100644
--- a/hack-module.awk
+++ b/hack-module.awk
@@ -106,7 +106,10 @@
 }
 
 /ip_summed == CHECKSUM_PARTIAL\)/ {
-    print "#ifndef COMPAT_csum_offset";
+    print "#ifdef COMPAT_csum_offset";
+    print "\thdr->flags = 0;"
+    print "\thdr->csum_offset = hdr->csum_start = 0;"
+    print "#else"
     need_endif_indent_brace = 1;
 }
 
-- 
1.5.4.1

