diff options
author | 2019-02-17 04:44:44 +0100 | |
---|---|---|
committer | 2019-02-17 04:58:43 +0100 | |
commit | cdae716b871b9c037fcb945d276dabe959275baa (patch) | |
tree | 7cc58b7c540e86ad8674e14a8739804d18db18ff /src | |
parent | chacha20: name enums (diff) | |
download | wireguard-linux-compat-cdae716b871b9c037fcb945d276dabe959275baa.tar.xz wireguard-linux-compat-cdae716b871b9c037fcb945d276dabe959275baa.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>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/compat/compat.h | 2 |
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 |