fix IPAddress equality comparison (#57250)
authorGeoff Kizer <geoffrek@microsoft.com>
Thu, 12 Aug 2021 05:58:49 +0000 (22:58 -0700)
committerGitHub <noreply@github.com>
Thu, 12 Aug 2021 05:58:49 +0000 (22:58 -0700)
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs

index 5052c5f..3496275 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
         internal static unsafe SOCKADDR_INET IPEndPointToINet(IPEndPoint endpoint)
         {
             SOCKADDR_INET socketAddress = default;
-            if (endpoint.Address != IPAddress.Any && endpoint.Address != IPAddress.IPv6Any)
+            if (!endpoint.Address.Equals(IPAddress.Any) && !endpoint.Address.Equals(IPAddress.IPv6Any))
             {
                 switch (endpoint.Address.AddressFamily)
                 {