mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-16 23:15:37 +00:00
Fix ip4 loopback when LWIP_SINGLE_NETIF si used
When LWIP_SINGLE_NETIF is used, LWIP_NETIF_LOOPBACK case is not managed at all in the ip4_route() function. Consequently any ip4 loopback packet is rejected. This adds the required code to fix this.
This commit is contained in:
parent
73fcf72792
commit
9ea624a249
@ -211,6 +211,19 @@ ip4_route(const ip4_addr_t *dest)
|
||||
return netif;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if LWIP_NETIF_LOOPBACK
|
||||
/* in single netif mode, loopback traffic should be passed through default netif (if defined and up) */
|
||||
if (ip4_addr_isloopback(dest)) {
|
||||
/* don't check for link on loopback traffic */
|
||||
if ((netif_default != NULL) && netif_is_up(netif_default)) {
|
||||
return netif_default;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* LWIP_NETIF_LOOPBACK */
|
||||
|
||||
#endif /* !LWIP_SINGLE_NETIF */
|
||||
|
||||
if ((netif_default == NULL) || !netif_is_up(netif_default) || !netif_is_link_up(netif_default) ||
|
||||
|
Loading…
Reference in New Issue
Block a user