From 1bf1c38b30a12472d9cb2f36718ba69c9d43abe0 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 16 Jun 2016 18:23:33 -0700 Subject: Default route population works on Mac! --- node/InetAddress.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'node') 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(&addr)->sin_addr.s_addr) >> (32 - bits)) == (Utils::ntoh((uint32_t)reinterpret_cast(this)->sin_addr.s_addr) >> (32 - bits)) ); } case AF_INET6: { -- cgit v1.2.3