From 5358380c5fe2a0a284d9597c858641bb18e49871 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Thu, 3 Mar 2016 16:12:20 +0100 Subject: [PATCH] Apply patch from Derek Pravala: Fix segfault in ip6_route when there is no default netif --- src/core/ipv6/ip6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index d9eca758..24a5f622 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -184,7 +184,7 @@ ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest) #endif /* LWIP_NETIF_LOOPBACK && !LWIP_HAVE_LOOPIF */ /* no matching netif found, use default netif, if up */ - if (!netif_is_up(netif_default) || !netif_is_link_up(netif_default)) { + if ((netif_default == NULL) || !netif_is_up(netif_default) || !netif_is_link_up(netif_default)) { return NULL; } return netif_default;