aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-05 22:59:40 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-05 22:59:40 +0200
commitc211f7d1e2c27e22e11581bef5a847582b26c08b (patch)
tree0b4be584f3dffab7baf153e51c09f161742fdc8c /src/compat/compat.h
parentMakefile: clang now builds the kernel, so use scan-build (diff)
downloadwireguard-monolithic-historical-c211f7d1e2c27e22e11581bef5a847582b26c08b.tar.xz
wireguard-monolithic-historical-c211f7d1e2c27e22e11581bef5a847582b26c08b.zip
compat: macro rewrite netlink instead of cluttering
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index b422c6d..c75bfe3 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -440,6 +440,19 @@ static inline struct nlattr **genl_family_attrbuf(const struct genl_family *fami
#endif
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+#define get_device_dump(a, b) get_device_dump_real(a, b); \
+static int get_device_dump(a, b) { \
+ struct wireguard_device *wg = (struct wireguard_device *)cb->args[0]; \
+ if (!wg) { \
+ int ret = get_device_start(cb); \
+ if (ret) \
+ return ret; \
+ } \
+ return get_device_dump_real(skb, cb); \
+} \
+static int get_device_dump_real(a, b)
+#endif
/* https://lkml.org/lkml/2017/6/23/790 */
#if IS_ENABLED(CONFIG_NF_CONNTRACK)