aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-17 13:10:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-29 01:23:24 +0200
commitfe2edb0f37b99b25d0ee20da9f99293dd8cb686e (patch)
tree3bbd8a03e2f561c70340b769ce481197b02651e2 /src/compat/compat.h
parentqemu: use newer iproute2 and kernel (diff)
downloadwireguard-linux-compat-fe2edb0f37b99b25d0ee20da9f99293dd8cb686e.tar.xz
wireguard-linux-compat-fe2edb0f37b99b25d0ee20da9f99293dd8cb686e.zip
netlink: use new strict length types in policy for 5.2
Reported-by: Bruno Wolff III <bruno@wolff.to> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index e8fa1ab..436fe44 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -821,6 +821,14 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
+#define NLA_EXACT_LEN NLA_UNSPEC
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+#define NLA_MIN_LEN NLA_UNSPEC
+#define COMPAT_CANNOT_INDIVIDUAL_NETLINK_OPS_POLICY
+#endif
+
/* https://github.com/ClangBuiltLinux/linux/issues/7 */
#if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000)
#include <linux/bug.h>