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 committed Jul 29, 2022
1 parent 475d658 commit c950063
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 @@ -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 */

Expand Down

0 comments on commit c950063

Please sign in to comment.