diff --git a/components/net/lwip-2.1.2/src/arch/sys_arch.c b/components/net/lwip-2.1.2/src/arch/sys_arch.c index 2f612bd6b3..5107708a8a 100644 --- a/components/net/lwip-2.1.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/src/arch/sys_arch.c @@ -786,21 +786,21 @@ struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src) /* iterate through netifs */ for (netif = netif_list; netif != NULL; netif = netif->next) { - /* is the netif up, does it have a link and a valid address? */ - if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif))) - { - /* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */ - if (src != NULL) - { - if (ip4_addr_cmp(src, netif_ip4_addr(netif))) + /* is the netif up, does it have a link and a valid address? */ + if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif))) { - return netif; + /* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */ + if (src != NULL) + { + if (ip4_addr_cmp(src, netif_ip4_addr(netif))) + { + return netif; + } + } } } - } - } - netif = netif_default; - return netif; + netif = netif_default; + return netif; } /*