aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-12 12:12:53 +0900
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-14 10:24:20 +0100
commitdf318d1f0526663a2d92439376379e32ebcfef1a (patch)
tree0863885913021a2ad101e318bd535520494a936e /src
parentcurve25519-neon: compile in thumb mode (diff)
downloadwireguard-monolithic-historical-df318d1f0526663a2d92439376379e32ebcfef1a.tar.xz
wireguard-monolithic-historical-df318d1f0526663a2d92439376379e32ebcfef1a.zip
compat: fix compilation with PaX
Despite not having access to the latest grsecurity source, I still do very much want to keep supporting it, so this patch is my best guess at what will work.
Diffstat (limited to 'src')
-rw-r--r--src/compat/compat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index e4dd226..276e7c9 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -561,5 +561,17 @@ static inline void new_icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32
#undef __read_mostly
#define __read_mostly
#endif
+#if defined(RAP_PLUGIN) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+#include <linux/timer.h>
+#define expired_retransmit_handshake(a) expired_retransmit_handshake(unsigned long timer)
+#define expired_send_keepalive(a) expired_send_keepalive(unsigned long timer)
+#define expired_new_handshake(a) expired_new_handshake(unsigned long timer)
+#define expired_zero_key_material(a) expired_zero_key_material(unsigned long timer)
+#define expired_send_persistent_keepalive(a) expired_send_persistent_keepalive(unsigned long timer)
+#undef timer_setup
+#define timer_setup(a, b, c) setup_timer(a, ((void (*)(unsigned long))b), ((unsigned long)a))
+#undef from_timer
+#define from_timer(var, callback_timer, timer_fieldname) container_of((struct timer_list *)callback_timer, typeof(*var), timer_fieldname)
+#endif
#endif /* _WG_COMPAT_H */