|
|
|
@ -183,15 +183,15 @@ bool CNetAddr::IsTor() const
|
|
|
|
|
bool CNetAddr::IsLocal() const
|
|
|
|
|
{
|
|
|
|
|
// IPv4 loopback
|
|
|
|
|
if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0))
|
|
|
|
|
return true;
|
|
|
|
|
if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
// IPv6 loopback (::1/128)
|
|
|
|
|
static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
|
|
|
|
|
if (memcmp(ip, pchLocal, 16) == 0)
|
|
|
|
|
return true;
|
|
|
|
|
// IPv6 loopback (::1/128)
|
|
|
|
|
static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
|
|
|
|
|
if (memcmp(ip, pchLocal, 16) == 0)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CNetAddr::IsValid() const
|
|
|
|
|