Apply patch from Derek Pravala: Fix segfault in ip6_route when there is no default netif

This commit is contained in:
Dirk Ziegelmeier 2016-03-03 16:12:20 +01:00
parent eead3a7038
commit 5358380c5f

View File

@ -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;