From a1a92920b229f6dc43e60f5cfc8825ca8b76a0e1 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 12 Jul 2024 18:21:47 +0100 Subject: [PATCH] DEV9: Fix handling of ICMP timeout --- pcsx2/DEV9/Sessions/ICMP_Session/ICMP_Session.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pcsx2/DEV9/Sessions/ICMP_Session/ICMP_Session.cpp b/pcsx2/DEV9/Sessions/ICMP_Session/ICMP_Session.cpp index 565f9ce908..6e690f8239 100644 --- a/pcsx2/DEV9/Sessions/ICMP_Session/ICMP_Session.cpp +++ b/pcsx2/DEV9/Sessions/ICMP_Session/ICMP_Session.cpp @@ -189,8 +189,16 @@ namespace Sessions { ResetEvent(icmpEvent); - [[maybe_unused]] int count = IcmpParseReplies(icmpResponseBuffer.get(), icmpResponseBufferLen); - pxAssert(count == 1); + int count = IcmpParseReplies(icmpResponseBuffer.get(), icmpResponseBufferLen); + pxAssert(count <= 1); + + // Timeout + if (count == 0) + { + result.type = -2; + result.code = 0; + return &result; + } // Rely on implicit object creation ICMP_ECHO_REPLY* pingRet = reinterpret_cast(icmpResponseBuffer.get());