RHEL-8.1 backported a couple features breaking wireguard compilation.

Sergey Ivanov seriv at cs.umd.edu
Thu Dec 5 13:55:57 CET 2019


Hi,

on kernel 4.18.0-147.el8.x86_64 I am not able to compile 
https://git.zx2c4.com/WireGuard sources, tried tags 0.0.20191127 and  
0.0.20191205 and master at 5eb87fb649.

To compile it I did the following workaround:

===


$ git diff
diff --git a/src/compat/compat.h b/src/compat/compat.h
index ab22fa4..6e034b5 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -326,7 +326,7 @@ static inline int wait_for_random_bytes(void)
  }
  #endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE 
 >= KERNEL_VERSION(4, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && defined(ISRHEL8) 
&& RHEL_MINOR < 1 && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
  #include <linux/random.h>
  #include <linux/slab.h>
  struct rng_is_initialized_callback {
@@ -831,7 +831,7 @@ static inline void skb_mark_not_on_list(struct 
sk_buff *skb)
  }
  #endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) && (!defined(ISRHEL8) 
|| RHEL_MINOR < 1)
  #define NLA_EXACT_LEN NLA_UNSPEC
  #endif
  #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
===

-- 

   Regards,

   Sergey Ivanov



More information about the WireGuard mailing list