summaryrefslogtreecommitdiffhomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-13 16:47:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-13 17:01:55 +0200
commit4e10b859d51979b6ebbb90745d37f2f310e8847d (patch)
treebc17cfd97c44b2bee782849f6e94ad7198bf1465 /src/compat/compat.h
parentd0aebce0cf6cb825ed28f1597d318dbce6d764fd (diff)
compat: don't clear header bits on RHEL
The 3.10 kernel from Red Hat puts head_frag in between headers_start and headers_end. This is triggered on the latest i40e driver. This results in the packet being freed incorrectly, crashing the system. So, this patch just ensures we don't zero any of the header bits. The whole issue of zeroing header bits probably should be revisited sometime somewhat soon. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 1317345..27f22b3 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -34,7 +34,10 @@
#error "WireGuard requires Linux >= 3.10"
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(ISRHEL7)
+#if defined(ISRHEL7)
+#include <linux/skbuff.h>
+#define headers_end headers_start
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
#define headers_start data
#define headers_end data
#endif