Update Emby.Server.Implementations/Networking/NetworkManager.cs

Co-authored-by: Cody Robibero <cody@robibe.ro>
pull/3620/head
BaronGreenback 4 years ago committed by GitHub
parent bde1a38a88
commit f983ea95d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -152,12 +152,12 @@ namespace Emby.Server.Implementations.Networking
return true; return true;
} }
if (!IPAddress.TryParse(endpoint, out _)) if (!IPAddress.TryParse(endpoint, out var ipAddress))
{ {
return false; return false;
} }
byte[] octet = IPAddress.Parse(endpoint).GetAddressBytes(); byte[] octet = ipAddress.GetAddressBytes();
if ((octet[0] == 10) || if ((octet[0] == 10) ||
(octet[0] == 172 && (octet[1] >= 16 && octet[1] <= 31)) || // RFC1918 (octet[0] == 172 && (octet[1] >= 16 && octet[1] <= 31)) || // RFC1918

Loading…
Cancel
Save