Skip to content

Commit

Permalink
napt: Fix IP forwarding when forward netif enable NAPT
Browse files Browse the repository at this point in the history
* Fix communication between different netifs fails if NAPT is enabled
* Fixes IDF-4896
  • Loading branch information
ESP-YJM authored and espressif-abhikroy committed Sep 22, 2023
1 parent b55e64a commit bc78df8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/ipv4/ip4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit bc78df8

Please sign in to comment.