wengzhe commented on issue #16429: URL: https://github.com/apache/nuttx/issues/16429#issuecomment-2913057738
> > [@zhhyu7](https://github.com/zhhyu7) I think we have two ways to fix it, which way do you think is better? > > > > 1. Don't allow choosing `icmp->id` as `0`, that is, return a positive number when `local_port == 0`. > > 2. Change the return value type, and use a negative number as an error. > > I believe the second way is better. I'm currently working on a router project using NuttX. During debugging on a PC with Wireshark, I observed that the `icmp->id` between certain clients and servers are indeed 0. However, as a router, we cannot simply drop these packets. @CosmicRoach Both methods will allow clients and servers to communicate. You can try setting `local_port` in `nat_port_select` to `local_port = MAX(local_port, 1)` and see what happens. If `nat_port_select` returns `1`, the NAT will change `icmp->id` to `1` and continue the remaining steps, and the communication will succeed. -- 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