Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Sep 5, 2024
1 parent 25fcfe8 commit dc15610
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public static IPAddress[] GetHostAddresses(string hostNameOrAddress, AddressFami

// See if it's an IP Address.
IPAddress[] addresses;
#if TARGET_WASI
if (IPAddress.TryParse(hostNameOrAddress, out IPAddress? address))
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
Expand All @@ -219,6 +220,7 @@ public static IPAddress[] GetHostAddresses(string hostNameOrAddress, AddressFami
addresses = (family == AddressFamily.Unspecified || address.AddressFamily == family) ? new IPAddress[] { address } : Array.Empty<IPAddress>();
}
else
#endif
{
addresses = GetHostAddressesCore(hostNameOrAddress, family);
}
Expand Down

0 comments on commit dc15610

Please sign in to comment.