summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2025-08-12 14:43:19 +0200
committerJerome Forissier <jerome.forissier@linaro.org>2025-08-18 14:08:57 +0200
commit6b914d5596d947ebea4e8697004e210df1abe61e (patch)
treed07966a8bb0478012f8b991760059ae3c8fb3dc4 /lib
parentfbd79b493d943a2f41a78408cc99ca4ee4392b07 (diff)
net: lwip: add Kconfig option to show ICMP unreachable errors
Add Kconfig symbol LWIP_ICMP_SHOW_UNREACH which, when enabled, prints a message to the console upon reception of ICMP unreachable messages. For example: $ make qemu_arm64_lwip_defconfig $ qemu-system-aarch64 -M virt -cpu max -nographic -bios u-boot.bin [...] => dhcp DHCP client bound to address 10.0.2.15 (0 ms) => tftp 192.168.0.100:69:Image Using virtio-net#32 device TFTP from server 192.168.0.100; our IP address is 10.0.2.15 Filename 'Image'. Load address: 0x40200000 Loading: ICMP destination unreachable (host unreachable) from 192.168.0.16 Timeout! => tftp 192.168.0.16:69:Image Using virtio-net#32 device TFTP from server 192.168.0.16; our IP address is 10.0.2.15 Filename 'Image'. Load address: 0x40200000 Loading: ICMP destination unreachable (port unreachable) from 192.168.0.16 Timeout! => Submitted upstream as https://github.com/lwip-tcpip/lwip/pull/73. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/lwip/u-boot/arch/cc.h7
-rw-r--r--lib/lwip/u-boot/lwipopts.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/lwip/u-boot/arch/cc.h b/lib/lwip/u-boot/arch/cc.h
index 04ab94d6b70..849c79c5a8d 100644
--- a/lib/lwip/u-boot/arch/cc.h
+++ b/lib/lwip/u-boot/arch/cc.h
@@ -56,4 +56,11 @@ static inline const char *sntp_format_time(time_t t)
}
#define sntp_format_time sntp_format_time
+
+#ifdef CONFIG_LWIP_ICMP_SHOW_UNREACH
+struct pbuf;
+void net_lwip_icmp_dest_unreach(int code, struct pbuf *p);
+
+#define ICMP_DEST_UNREACH_CB(_c, _p) net_lwip_icmp_dest_unreach(_c, _p)
+#endif
#endif /* LWIP_ARCH_CC_H */
diff --git a/lib/lwip/u-boot/lwipopts.h b/lib/lwip/u-boot/lwipopts.h
index 46af91f9410..80b93ea172d 100644
--- a/lib/lwip/u-boot/lwipopts.h
+++ b/lib/lwip/u-boot/lwipopts.h
@@ -80,7 +80,11 @@
#define IP_DEFAULT_TTL 255
+#if defined(CONFIG_PROT_ICMP_LWIP)
+#define LWIP_ICMP 1
+#else
#define LWIP_ICMP 0
+#endif
#if defined(CONFIG_PROT_RAW_LWIP)
#define LWIP_RAW 1