|
|
@ -152,7 +152,12 @@ namespace Emby.Server.Implementations.Networking
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
byte[] octet = IPAddress.Parse(endpoint).GetAddressBytes();
|
|
|
|
if (!IPAddress.TryParse(endpoint, out var ipAddress))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
@ -268,6 +273,12 @@ namespace Emby.Server.Implementations.Networking
|
|
|
|
string excludeAddress = "[" + addressString + "]";
|
|
|
|
string excludeAddress = "[" + addressString + "]";
|
|
|
|
var subnets = LocalSubnetsFn();
|
|
|
|
var subnets = LocalSubnetsFn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Include any address if LAN subnets aren't specified
|
|
|
|
|
|
|
|
if (subnets.Length == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Exclude any addresses if they appear in the LAN list in [ ]
|
|
|
|
// Exclude any addresses if they appear in the LAN list in [ ]
|
|
|
|
if (Array.IndexOf(subnets, excludeAddress) != -1)
|
|
|
|
if (Array.IndexOf(subnets, excludeAddress) != -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|