From d15e757575fc15eb969d3d354913e1424ac2bac9 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Fri, 12 Jul 2024 19:47:03 +0200 Subject: [PATCH] Add missing cancellation throw in SendPingAsync path (#104780) --- .../src/System/Net/NetworkInformation/Ping.RawSocket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs index 7c2dd5879c8..a6feb951334 100644 --- a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs +++ b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs @@ -342,7 +342,7 @@ namespace System.Net.NetworkInformation // to the echo request we just sent. We need to filter such messages out, and continue reading until our timeout. // For example, when pinging the local host, we need to filter out our own echo requests that the socket reads. long startingTimestamp = Stopwatch.GetTimestamp(); - while (!timeoutOrCancellationToken.IsCancellationRequested) + while (true) { SocketReceiveFromResult receiveResult = await socket.ReceiveFromAsync( receiveBuffer.AsMemory(),