diff options
Diffstat (limited to 'node')
-rw-r--r-- | node/InetAddress.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/node/InetAddress.cpp b/node/InetAddress.cpp index dca772e8..30b1ff2e 100644 --- a/node/InetAddress.cpp +++ b/node/InetAddress.cpp @@ -279,6 +279,8 @@ bool InetAddress::containsAddress(const InetAddress &addr) const switch(ss_family) { case AF_INET: { const unsigned int bits = netmaskBits(); + if (bits == 0) + return true; return ( (Utils::ntoh((uint32_t)reinterpret_cast<const struct sockaddr_in *>(&addr)->sin_addr.s_addr) >> (32 - bits)) == (Utils::ntoh((uint32_t)reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr) >> (32 - bits)) ); } case AF_INET6: { |