diff --git a/CHANGELOG b/CHANGELOG index d36d686d..94df85e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -96,6 +96,9 @@ HISTORY ++ Bugfixes: + 2014-02-25: Simon Goldschmidt + ip4.c: fixed bug #39514 ip_route() may return an IPv6-only interface + 2014-02-25: Simon Goldschmidt, patch by Fatih Asici * pbuf.c: fixed bug #39356 Wrong increment in pbuf_memfind() diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index 04a36111..48d2a391 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -123,7 +123,12 @@ ip_route(ip_addr_t *dest) /* iterate through netifs */ for (netif = netif_list; netif != NULL; netif = netif->next) { /* network mask matches? */ - if (netif_is_up(netif)) { + if ((netif_is_up(netif)) +#if LWIP_IPV6 + /* prevent using IPv6-only interfaces */ + && (!ip_addr_isany(&(netif->ip_addr))) +#endif /* LWIP_IPV6 */ + ) { if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) { /* return netif on which to forward IP packet */ return netif;