wengzhe commented on code in PR #7750: URL: https://github.com/apache/nuttx/pull/7750#discussion_r1037755691
########## net/ipforward/ipv4_forward.c: ########## @@ -505,6 +502,37 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) drop: ipv4_dropstats(ipv4); + +#ifdef CONFIG_NET_ICMP +#ifdef CONFIG_NET_NAT Review Comment: Done. ########## net/ipforward/ipv4_forward.c: ########## @@ -505,6 +502,37 @@ int ipv4_forward(FAR struct net_driver_s *dev, FAR struct ipv4_hdr_s *ipv4) drop: ipv4_dropstats(ipv4); + +#ifdef CONFIG_NET_ICMP +#ifdef CONFIG_NET_NAT + /* Before we reply ICMP, call NAT outbound to try to translate destination + * address & port back to original status. + */ + + if (ret == -ENETUNREACH || ret == -EFBIG || ret == -EMULTIHOP) + { + ipv4_nat_outbound(dev, ipv4, NAT_MANIP_DST); + } +#endif /* CONFIG_NET_NAT */ Review Comment: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org