From: Liu Han Date: Thu, 27 Apr 2017 10:59:47 +0000 (+0800) Subject: fix(lwip): fix tcp connect fail when enable LOOPIF X-Git-Tag: v2.1-rc1~136^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aeecbcc7ee64c56d031ecefd6777d6afa5737a4b;p=esp-idf fix(lwip): fix tcp connect fail when enable LOOPIF --- diff --git a/components/lwip/core/ipv4/ip4.c b/components/lwip/core/ipv4/ip4.c index 1d581d4d85..3877e20609 100755 --- a/components/lwip/core/ipv4/ip4.c +++ b/components/lwip/core/ipv4/ip4.c @@ -147,6 +147,9 @@ ip4_route(const ip4_addr_t *dest) { #if ESP_LWIP struct netif *non_default_netif = NULL; +#if LWIP_HAVE_LOOPIF + struct netif *loop_default_netif = netif_find("lo0"); +#endif #endif struct netif *netif; @@ -173,7 +176,11 @@ ip4_route(const ip4_addr_t *dest) } if (netif != netif_default){ +#if LWIP_HAVE_LOOPIF + non_default_netif = (netif == loop_default_netif) ? NULL : netif; +#else non_default_netif = netif; +#endif } } }