[BUG] nat_port_select() returned value not safe
- Dominant language
- C
- Stars
- 4k
- Forks
- 1.7k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 237
Description
### Description / Steps to reproduce the issue
Returned Value:
* External port number on success; 0 on failure
In some cases,when the return value is 0, it may indicate success.

ipv4_nat_outbound_icmp() use icmp->id as port, but some careless applications may send ICMP request packets with icmp->id == 0, in this case, nat_port_select() will return a port number of 0, this 0 is a selected result, not a failure to find a port.

The return value of 0 is interpreted as an error here, preventing subsequent processes from proceeding.

### On which OS does this issue occur?
[OS: Other]
### What is the version of your OS?
.
### NuttX Version
all
### Issue Architecture
[Arch: arm]
### Issue Area
[Area: Networking]
### Host information
_No response_
### Verification
- [x] I have verified before submitting the report.
Contributor guide
Assessment
This issue has not been assessed yet.