Skip to content

net/nat: Unlock on outbound NAT entry creation failure.#18674

Merged
linguini1 merged 1 commit intoapache:masterfrom
ankohuu:fix/nat-outbound-unlock
Apr 5, 2026
Merged

net/nat: Unlock on outbound NAT entry creation failure.#18674
linguini1 merged 1 commit intoapache:masterfrom
ankohuu:fix/nat-outbound-unlock

Conversation

@ankohuu
Copy link
Copy Markdown
Contributor

@ankohuu ankohuu commented Apr 4, 2026

Summary

Release nat_lock before returning -ENOENT from the IPv4
and IPv6 outbound NAT paths when NAT entry creation fails.

Impact

Bugfix

Testing

Config

~/P/nuttx [fix/nat-outbound-unlock] > rg -i nat .config
960:CONFIG_NET_NAT=y
961:CONFIG_NET_NAT44=y
962:CONFIG_NET_NAT44_FULL_CONE=y
963:# CONFIG_NET_NAT44_SYMMETRIC is not set
964:CONFIG_NET_NAT66=y
965:CONFIG_NET_NAT66_FULL_CONE=y
966:# CONFIG_NET_NAT66_SYMMETRIC is not set
967:CONFIG_NET_NAT_HASH_BITS=5
968:CONFIG_NET_NAT_TCP_EXPIRE_SEC=86400
969:CONFIG_NET_NAT_UDP_EXPIRE_SEC=240
970:CONFIG_NET_NAT_ICMP_EXPIRE_SEC=60
971:CONFIG_NET_NAT_ICMPv6_EXPIRE_SEC=60
972:CONFIG_NET_NAT_ENTRY_RECLAIM_SEC=3600

Builded successfully and launched NSH.

Release nat_lock before returning -ENOENT from the IPv4 and IPv6
outbound NAT paths when NAT entry creation fails.

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
@ankohuu ankohuu requested a review from jerpelea as a code owner April 4, 2026 01:01
@github-actions github-actions bot added Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small labels Apr 4, 2026
@linguini1 linguini1 merged commit 1e6c751 into apache:master Apr 5, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants