Default route population works on Mac!

This commit is contained in:
Adam Ierymenko 2016-06-16 18:23:33 -07:00
parent eb4a78bcc3
commit 1bf1c38b30
4 changed files with 18 additions and 4 deletions

View file

@ -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: {