net/nat: Add support for ICMP Error Message

Support DEST_UNREACHABLE, TIME_EXCEEDED and PARAMETER_PROBLEM ICMP types in NAT.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng
2022-11-15 17:49:43 +08:00
committed by Xiang Xiao
parent 23dfdeacab
commit 9aefd6717c
5 changed files with 205 additions and 15 deletions

View File

@@ -5,8 +5,14 @@ Network Address Translation (NAT)
NuttX supports full cone NAT logic, which currently supports
- TCP
- UDP
- ICMP ECHO (REQUEST & REPLY)
- ICMP
- ECHO (REQUEST & REPLY)
- Error Messages (DEST_UNREACHABLE & TIME_EXCEEDED & PARAMETER_PROBLEM)
Workflow
========
@@ -161,6 +167,12 @@ Validated on Ubuntu 22.04 x86_64 with NuttX SIM by following steps:
# LAN side
sudo ip netns exec LAN ping 8.8.8.8
.. code-block:: shell
# LAN side
sudo ip netns exec LAN traceroute -n 8.8.8.8 # ICMP error msg of UDP
sudo ip netns exec LAN traceroute -n -T 8.8.8.8 # ICMP error msg of TCP
.. code-block:: shell
# Host side