From faa21039618bbb21f7c2fc263d7f538befb53c5d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 13 May 2018 16:47:33 +0200 Subject: 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. --- src/compat/compat.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 +#define headers_end headers_start +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) #define headers_start data #define headers_end data #endif -- cgit v1.2.3-59-g8ed1b