napt: Fix IP forwarding when forward netif enable NAPT

* Fix communication between different netifs fails if NAPT is enabled
* Fixes IDF-4896
This commit is contained in:
yuanjm
2022-07-29 10:18:16 +08:00
parent 475d658a47
commit c950063f73
+5 -2
View File
@@ -383,8 +383,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 */