mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-20 23:26:56 +08:00
fixed bug #39514 ip_route() may return an IPv6-only interface
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user