diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index a5c3dd55b..0219e7c56 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -332,8 +332,11 @@ ip4_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp) #if ESP_LWIP #if IP_NAPT - if (ip_napt_forward(p, iphdr, inp, netif) != ERR_OK) - return; + /* If the output netif uses NAPT, we will not perform NAPT forwarding (because NAPT netif will not search the NAPT table on ip4_input) */ + if (!netif->napt) { + if (ip_napt_forward(p, iphdr, inp, netif) != ERR_OK) + return; + } #endif #endif /* ESP_LWIP */