diff --git a/node/InetAddress.cpp b/node/InetAddress.cpp index da1c7294c..2322427cb 100644 --- a/node/InetAddress.cpp +++ b/node/InetAddress.cpp @@ -28,10 +28,13 @@ const InetAddress InetAddress::LO6((const void *)("\x00\x00\x00\x00\x00\x00\x00\ InetAddress::IpScope InetAddress::ipScope() const { + char buf[255]; + fprintf(stderr, "scope for %s \t", this->toString(buf)); switch(ss_family) { case AF_INET: { const uint32_t ip = Utils::ntoh((uint32_t)reinterpret_cast(this)->sin_addr.s_addr); + fprintf(stderr, "AF_INET\n"); switch(ip >> 24) { case 0x00: return IP_SCOPE_NONE; // 0.0.0.0/8 (reserved, never used) @@ -112,6 +115,7 @@ InetAddress::IpScope InetAddress::ipScope() const } break; case AF_INET6: { + fprintf(stderr, "AF_INET6\n"); const unsigned char *ip = reinterpret_cast(reinterpret_cast(this)->sin6_addr.s6_addr); if ((ip[0] & 0xf0) == 0xf0) { if (ip[0] == 0xff) { diff --git a/service/OneService.cpp b/service/OneService.cpp index 6807d3534..ccaf2c00b 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1698,7 +1698,7 @@ class OneServiceImpl : public OneService bool isAuth = false; // If localhost, allow char buf[255]; - fprintf(stderr, "remote Addr: %s\n", remoteAddr.toIpString(buf)); + fprintf(stderr, "scope: %d, remote Addr: %s\n", remoteAddr.ipScope(),remoteAddr.toIpString(buf)); if (remoteAddr.ipScope() == InetAddress::IP_SCOPE_LOOPBACK) { ipAllowed = true; }