aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-17 04:44:44 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-17 04:58:43 +0100
commita8f8457fa59b5167c1668884e8773984e6807b03 (patch)
tree51392c16a761666db1b3447beee764c76206fb96
parenttools: c_acc doesn't need to be initialized (diff)
downloadwireguard-monolithic-historical-a8f8457fa59b5167c1668884e8773984e6807b03.tar.xz
wireguard-monolithic-historical-a8f8457fa59b5167c1668884e8773984e6807b03.zip
compat: ipv6_stub is sometimes null
On ancient kernels, ipv6_stub is sometimes null in cases where IPv6 has been disabled with a command line flag or other failures. Reported-by: Anatoli <me@anatoli.ws>
-rw-r--r--src/compat/compat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 19dd71a..ae3189f 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -109,7 +109,7 @@ static const struct ipv6_stub_type *ipv6_stub = &ipv6_stub_impl;
#include <net/addrconf.h>
static inline bool ipv6_mod_enabled(void)
{
- return ipv6_stub->udpv6_encap_enable != NULL;
+ return ipv6_stub != NULL && ipv6_stub->udpv6_encap_enable != NULL;
}
#endif