aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 22:30:37 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-01 00:55:19 +0100
commit47b9e2396a11181ecd8bae10a4a7589efd1c80bf (patch)
treec68078a9b1bb798eeecc970ab4610769497208f4 /src/compat/compat.h
parentversion: bump snapshot (diff)
downloadwireguard-linux-compat-47b9e2396a11181ecd8bae10a4a7589efd1c80bf.tar.xz
wireguard-linux-compat-47b9e2396a11181ecd8bae10a4a7589efd1c80bf.zip
timers: switch to kees' new timer_list functions
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r--src/compat/compat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index cbb00e5..55d6af4 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -502,6 +502,11 @@ struct _____dummy_container { char dev; };
#define netdev_notifier_info net_device *)data); __attribute((unused)) char _____dummy = ((struct _____dummy_container
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
+#define timer_setup(a, b, c) setup_timer(a, ((void (*)(unsigned long))b), ((unsigned long)a))
+#define from_timer(var, callback_timer, timer_fieldname) container_of(callback_timer, typeof(*var), timer_fieldname)
+#endif
+
/* https://lkml.org/lkml/2017/6/23/790 */
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <linux/ip.h>