parent
48c6461945
commit
36b7157589
|
@ -167,6 +167,11 @@ namespace MediaBrowser.Common.Net
|
|||
address = address.MapToIPv4();
|
||||
}
|
||||
|
||||
if (address.AddressFamily != AddressFamily)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var (altAddress, altPrefix) = NetworkAddressOf(address, PrefixLength);
|
||||
return NetworkAddress.Address.Equals(altAddress) && NetworkAddress.PrefixLength >= altPrefix;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace Jellyfin.Networking.Tests
|
|||
[InlineData("fd23:184f:2029:0::/56", "fd24:184f:2029:0:3139:7386:67d7:d517")]
|
||||
[InlineData("fd23:184f:2029:0::/56, !fd23:184f:2029:0:3139:7386:67d7:d500/120", "fd23:184f:2029:0:3139:7386:67d7:d517")]
|
||||
[InlineData("fd23:184f:2029:0::/56", "192.168.10.60")]
|
||||
[InlineData("2001:abcd:abcd:6b40::0/60", "192.168.10.60")]
|
||||
public void InNetwork_False_Success(string network, string value)
|
||||
{
|
||||
var ip = IPAddress.Parse(value);
|
||||
|
|
Loading…
Reference in New Issue
Block a user