From a8f8457fa59b5167c1668884e8773984e6807b03 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 17 Feb 2019 04:44:44 +0100 Subject: 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 --- src/compat/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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 -- cgit v1.2.3-59-g8ed1b