diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-06 22:42:26 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-06 22:47:32 +0100 |
commit | 72d34c0edc5ad9e69e0d054459ec15d2278f206b (patch) | |
tree | eefb140b8e3b800bfaec48f9e12513cb17d306a9 | |
parent | 5cdb82111cc128d68ba5268eb94787110ce1fe6e (diff) | |
parent | 87aa0b48afe5a070e6e11e502a1803da6add5197 (diff) |
Merge #15343: [doc] netaddress: Make IPv4 loopback comment more descriptive
87aa0b48afe5a070e6e11e502a1803da6add5197 netaddress: Make IPv4 loopback comment more descriptive (Carl Dong)
6180b5f32bbcd7ef18db772290954161806e609e netaddress: Fix indentation in IsLocal (Carl Dong)
Pull request description:
This also makes the comment match the IPv6 comment just below this hunk.
Tree-SHA512: 9b91195e71e18156c9e013f63a6d430c67951aabb4a0c2f48f3bf852570c13887572b9e2fa52f4e1beba8685a9cae8949d4d03cd618a78f88566cf9e85dc64a8
-rw-r--r-- | src/netaddress.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp index a0c7f8e3c2..58e45c2c02 100644 --- a/src/netaddress.cpp +++ b/src/netaddress.cpp @@ -182,16 +182,16 @@ bool CNetAddr::IsTor() const bool CNetAddr::IsLocal() const { - // IPv4 loopback - if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0)) - return true; + // IPv4 loopback (127.0.0.0/8 or 0.0.0.0/8) + 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 |