fix: private IP checker wasn't working correctly for some reason

This commit is contained in:
spiral 2021-11-29 21:35:56 -05:00
parent 56d07e0f2d
commit 9dbc120bbc
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -79,12 +79,14 @@ public static class DispatchExt
{ {
if ((address.Address & 0x7f000000) == 0x7f000000) // 127.0/8 if ((address.Address & 0x7f000000) == 0x7f000000) // 127.0/8
return false; return false;
if ((address.Address & 0x0a000000) == 0x0a000000) // 10.0/8 if ((address.Address & 0xa000000) == 0xa000000) // 10.0/8
return false; return false;
if ((address.Address & 0xa9fe0000) == 0xa9fe0000) // 169.254/16 if ((address.Address & 0xa9fe0000) == 0xa9fe0000) // 169.254/16
return false; return false;
if ((address.Address & 0xac100000) == 0xac100000) // 172.16/12 if ((address.Address & 0xac100000) == 0xac100000) // 172.16/12
return false; return false;
if ((address.Address & 0xc0a80000) == 0xc0a80000) // 192.168/16
return false;
} }
if (host.AddressList.Any(address => address.IsIPv6LinkLocal)) if (host.AddressList.Any(address => address.IsIPv6LinkLocal))