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 <daichuan@xiaomi.com>
This commit is contained in:
daichuan
2026-01-14 15:34:26 +08:00
committed by archer
parent 303bc7411f
commit 32ffc69bdd
+4
View File
@@ -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)