This is an automated email from the ASF dual-hosted git repository.

archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 32ffc69bdde net/icmp: Fix devif_loopback dead loop when unrecognized 
ICMP packet received
32ffc69bdde is described below

commit 32ffc69bdde364fc851762a3497e5cfa158d22be
Author: daichuan <[email protected]>
AuthorDate: Wed Jan 14 15:34:26 2026 +0800

    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 <[email protected]>
---
 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)

Reply via email to