From cdae716b871b9c037fcb945d276dabe959275baa 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 Signed-off-by: Jason A. Donenfeld --- src/compat/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compat') 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