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-06-16 16:03:54 +08:00
committed by Abhik Roy
parent b55e64aedb
commit bc78df87fd
+5 -2
View File
@@ -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 */