summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-15 15:46:57 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-15 15:46:57 -0700
commit3c655a4b8479a8c4a332cc4f36315c7841da34e7 (patch)
tree736d6ead0823576a1aab48743487d710ff0e9fda /node
parentb90e66f7c7546aaf9c0c8a6bf14cc834f82fa680 (diff)
downloadinfinitytier-3c655a4b8479a8c4a332cc4f36315c7841da34e7.tar.gz
infinitytier-3c655a4b8479a8c4a332cc4f36315c7841da34e7.zip
Default route ready to test on Mac.
Diffstat (limited to 'node')
-rw-r--r--node/InetAddress.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp
index 1d171ba7..8abf1c04 100644
--- a/node/InetAddress.hpp
+++ b/node/InetAddress.hpp
@@ -245,18 +245,18 @@ struct InetAddress : public sockaddr_storage
/**
* @return True if this network/netmask route describes a default route (e.g. 0.0.0.0/0)
*/
- inline bool isDefaultRoute()
+ inline bool isDefaultRoute() const
{
switch(ss_family) {
case AF_INET:
- return ( (reinterpret_cast<struct sockaddr_in *>(this)->sin_addr.s_addr == 0) && (reinterpret_cast<struct sockaddr_in *>(this)->sin_port == 0) );
+ return ( (reinterpret_cast<const struct sockaddr_in *>(this)->sin_addr.s_addr == 0) && (reinterpret_cast<const struct sockaddr_in *>(this)->sin_port == 0) );
case AF_INET6:
- const uint8_t *ipb = reinterpret_cast<const uint8_t *>(reinterpret_cast<struct sockaddr_in6 *>(this)->sin6_addr.s6_addr);
+ const uint8_t *ipb = reinterpret_cast<const uint8_t *>(reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_addr.s6_addr);
for(int i=0;i<16;++i) {
if (ipb[i])
return false;
}
- return (reinterpret_cast<struct sockaddr_in6 *>(this)->sin6_port == 0);
+ return (reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_port == 0);
}
return false;
}