From 32ffc69bdde364fc851762a3497e5cfa158d22be Mon Sep 17 00:00:00 2001 From: daichuan Date: Wed, 14 Jan 2026 15:34:26 +0800 Subject: [PATCH] net/icmp: Fix devif_loopback dead loop when unrecognized ICMP packet received When an unrecognized ICMP (type=3, code=2) packet is received, the ICMP flow does not set dev->d_len to 0, causing a devif_loopback dead loop. Therefore, in ICMP input processing, when an ICMP_DEST_UNREACHABLE message is received, if it is not ICMP_FRAG_NEEDED code, jump to typeerr for error handling. Signed-off-by: daichuan --- net/icmp/icmp_input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/icmp/icmp_input.c b/net/icmp/icmp_input.c index 8bca6325ede..69b5e76ff8a 100644 --- a/net/icmp/icmp_input.c +++ b/net/icmp/icmp_input.c @@ -443,6 +443,10 @@ void icmp_input(FAR struct net_driver_s *dev) goto icmp_send_nothing; } + else + { + goto typeerr; + } } #endif else if (icmp->type == ICMP_TIMESTAMP_REQUEST)