public unsafe override bool IsKLined(IPAddress fullIp)
{
byte[] bytes = fullIp.GetAddressBytes();
if (bytes.Length < 4)
{
return true;
}
unchecked
{
uint ip;
fixed (byte* pBytes = bytes)
{
int offset = bytes.Length - 4;
ip = *(uint*)&pBytes[offset];
}
Cidr[] ks = Lines.K;
for (int i = 0; i < ks.Length; i++)
{
Cidr cidr = ks[i];
uint mask = cidr.Ip >> (32 - cidr.Mask);
uint match = ip >> (32 - cidr.Mask);
if (match == mask)
{
return true;
}
}
}
return false;
}