summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-11-18 13:01:45 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-11-18 13:01:45 -0800
commit25f9c294dc677576ded51025b2c7e6397bdc11c0 (patch)
tree1dafb6ceea86828f998704e4205b35bda7dd135d
parent2ea9f516e121ea6eb344a8d180a739a1d707aecb (diff)
downloadinfinitytier-25f9c294dc677576ded51025b2c7e6397bdc11c0.tar.gz
infinitytier-25f9c294dc677576ded51025b2c7e6397bdc11c0.zip
Small bug fix and warning removal.
-rw-r--r--controller/EmbeddedNetworkController.cpp12
-rw-r--r--node/InetAddress.hpp2
2 files changed, 8 insertions, 6 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp
index b78f847e..74937dd8 100644
--- a/controller/EmbeddedNetworkController.cpp
+++ b/controller/EmbeddedNetworkController.cpp
@@ -1776,11 +1776,13 @@ void EmbeddedNetworkController::_pushMemberUpdate(uint64_t now,uint64_t nwid,con
std::map<std::pair<uint64_t,uint64_t>,uint64_t>::iterator lrt(_lastRequestTime.find(std::pair<uint64_t,uint64_t>(id.address().toInt(),nwid)));
online = ( (lrt != _lastRequestTime.end()) && ((now - lrt->second) < ZT_NETWORK_AUTOCONF_DELAY) );
}
- Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> *metaData = new Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY>(mdstr.c_str());
- try {
- this->request(nwid,InetAddress(),0,id,*metaData);
- } catch ( ... ) {}
- delete metaData;
+ if (online) {
+ Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> *metaData = new Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY>(mdstr.c_str());
+ try {
+ this->request(nwid,InetAddress(),0,id,*metaData);
+ } catch ( ... ) {}
+ delete metaData;
+ }
}
} catch ( ... ) {}
}
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp
index 1dff710d..c37fa621 100644
--- a/node/InetAddress.hpp
+++ b/node/InetAddress.hpp
@@ -427,7 +427,7 @@ struct InetAddress : public sockaddr_storage
} else {
unsigned long tmp = reinterpret_cast<const struct sockaddr_in6 *>(this)->sin6_port;
const uint8_t *a = reinterpret_cast<const uint8_t *>(this);
- for(long i=0;i<sizeof(InetAddress);++i)
+ for(long i=0;i<(long)sizeof(InetAddress);++i)
reinterpret_cast<uint8_t *>(&tmp)[i % sizeof(tmp)] ^= a[i];
return tmp;
}