aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
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
commitfd54417e41c13f021609bf4f328bd7b9b8411e30 (patch)
treedae878abbb540f27644f1a146285aeeb7d4d720a /src/compat/compat.h
parentcompat: silence warning on frankenkernels (diff)
downloadwireguard-linux-compat-fd54417e41c13f021609bf4f328bd7b9b8411e30.tar.xz
wireguard-linux-compat-fd54417e41c13f021609bf4f328bd7b9b8411e30.zip
compat: support OpenSUSE 15
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-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