aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-03-09 13:47:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-03-09 13:47:18 +0100
commit9b1932816092d79360dee9e4ea0ad621f7f4a0dc (patch)
treeab697f179b322ab57f2a4fd05bde4778a1a161f1
parentcompat: silence warning on frankenkernels (diff)
downloadwireguard-monolithic-historical-9b1932816092d79360dee9e4ea0ad621f7f4a0dc.tar.xz
wireguard-monolithic-historical-9b1932816092d79360dee9e4ea0ad621f7f4a0dc.zip
compat: support OpenSUSE 15
-rw-r--r--src/compat/compat.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index ff6d2f1..d5c7527 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -25,6 +25,9 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
#define ISOPENSUSE42
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#define ISOPENSUSE15
+#endif
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
@@ -274,7 +277,7 @@ static const struct in6_addr our_in6addr_any = IN6ADDR_ANY_INIT;
#define in6addr_any our_in6addr_any
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) && !defined(ISOPENSUSE15)
#include <linux/completion.h>
#include <linux/random.h>
#include <linux/errno.h>
@@ -317,7 +320,7 @@ static inline int wait_for_random_bytes(void)
return 0;
}
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && !defined(ISOPENSUSE15)
static inline int get_random_bytes_wait(void *buf, int nbytes)
{
int ret = wait_for_random_bytes();
@@ -434,7 +437,7 @@ static inline void kvfree_ours(const void *addr)
#define priv_destructor destructor
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) && !defined(ISOPENSUSE15)
#define newlink(a,b,c,d,e) newlink(a,b,c,d)
#endif