aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-06-23 20:45:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-06-26 12:35:06 +0200
commit36fe0f3a410858990c992132b4ae8ba4bc511739 (patch)
tree4be2cfee73875cbd647ea030c382eca917716e65 /src/compat/compat.h
parentratelimiter: rewrite from scratch (diff)
downloadwireguard-linux-compat-36fe0f3a410858990c992132b4ae8ba4bc511739.tar.xz
wireguard-linux-compat-36fe0f3a410858990c992132b4ae8ba4bc511739.zip
socket: verify saddr belongs to interface
This helps "unstick" stuck source addresses, when changing routes dynamically. 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 feb4347..eb17c8e 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -279,6 +279,11 @@ static inline u64 ktime_get_ns(void)
}
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
+#include <linux/inetdevice.h>
+#define inet_confirm_addr(a,b,c,d,e) inet_confirm_addr(b,c,d,e)
+#endif
+
/* https://lkml.org/lkml/2015/6/12/415 */
#include <linux/netdevice.h>
static inline struct net_device *netdev_pub(void *dev)