diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-02-22 13:09:11 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-02-23 07:09:49 +0100 |
commit | 4b2ae43241e116fe50caa92f70655bde8ccb02eb (patch) | |
tree | e02850e2135e11483b18f91a7d277fc13417be26 /src/compat/compat.h | |
parent | device: disable ICMP redirects (diff) | |
download | wireguard-linux-compat-4b2ae43241e116fe50caa92f70655bde8ccb02eb.tar.xz wireguard-linux-compat-4b2ae43241e116fe50caa92f70655bde8ccb02eb.zip |
socket: do not try to create v6 socket when disabled
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r-- | src/compat/compat.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 6a9bfd9..277e7e7 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -153,6 +153,14 @@ __attribute__((unused)) static inline int udp_sock_create_new(struct net *net, s #define time_is_after_eq_jiffies64(a) time_before_eq64(get_jiffies_64(), a) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) && IS_ENABLED(CONFIG_IPV6) +#include <net/addrconf.h> +static inline bool ipv6_mod_enabled(void) +{ + return ipv6_stub->udpv6_encap_enable != NULL; +} +#endif + /* https://lkml.org/lkml/2015/6/12/415 */ #include <linux/netdevice.h> static inline struct net_device *netdev_pub(void *dev) |