From 0723a85ab3bb7a35d5fdf5278d0c3856bb336f5e Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 11 Sep 2019 15:52:18 -0700 Subject: [PATCH] Build fixes. --- controller/EmbeddedNetworkController.cpp | 2 +- node/AES.hpp | 1 + node/Hashtable.hpp | 6 ++++-- node/Multicaster.cpp | 2 +- node/Multicaster.hpp | 2 +- node/Network.hpp | 4 ++-- node/NetworkConfig.hpp | 4 ++-- osdep/Arp.hpp | 1 + osdep/NeighborDiscovery.hpp | 4 ---- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 3a7d2230..8bd1d62e 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1654,7 +1654,7 @@ void EmbeddedNetworkController::_request( DB::cleanMember(member); _db.save(member,true); - _sender->ncSendConfig(nwid,requestPacketId,identity.address(),*(nc.get()),metaData.getUI(ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_VERSION,0) < 6); + _sender->ncSendConfig(nwid,requestPacketId,identity.address(),*(nc.get()),false); } void EmbeddedNetworkController::_startThreads() diff --git a/node/AES.hpp b/node/AES.hpp index 4792cc8a..cab5afcb 100644 --- a/node/AES.hpp +++ b/node/AES.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #define ZT_AES_AESNI 1 #endif diff --git a/node/Hashtable.hpp b/node/Hashtable.hpp index a5f6b0f6..833edb48 100644 --- a/node/Hashtable.hpp +++ b/node/Hashtable.hpp @@ -16,6 +16,8 @@ #include "Constants.hpp" +#include + namespace ZeroTier { /** @@ -68,8 +70,8 @@ public: { for(;;) { if (_b) { - kptr = &(_b->k); - vptr = &(_b->v); + kptr = (K *)(&(_b->k)); + vptr = (V *)(&(_b->v)); _b = _b->next; return true; } diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp index 21f98a3b..e5d09cf5 100644 --- a/node/Multicaster.cpp +++ b/node/Multicaster.cpp @@ -46,7 +46,7 @@ unsigned int Multicaster::send( std::vector< std::pair > recipients; const NetworkConfig &config = network->config(); - if (config.multicastLimit == 0) return; // multicast disabled + if (config.multicastLimit == 0) return 0; // multicast disabled Address specialists[ZT_MAX_NETWORK_SPECIALISTS],multicastReplicators[ZT_MAX_NETWORK_SPECIALISTS]; unsigned int specialistCount = 0,multicastReplicatorCount = 0,bridgeCount = 0; diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp index e801fe9c..594608ab 100644 --- a/node/Multicaster.hpp +++ b/node/Multicaster.hpp @@ -178,7 +178,7 @@ public: } } std::sort(sortedByTime.begin(),sortedByTime.end()); - for(std::vector< std::pair >::const_reverse_iterator i(sortedByTime.begin());i!=sortedByTime.end();++i) { + for(std::vector< std::pair >::const_reverse_iterator i(sortedByTime.rbegin());i!=sortedByTime.rend();++i) { if (!func(i->second)) break; } diff --git a/node/Network.hpp b/node/Network.hpp index e98d9393..bfc6b2c9 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -404,8 +404,8 @@ public: { Mutex::Lock ml(_memberships_l); Hashtable::Iterator i(_memberships); - const Address *a = nullptr; - const Membership *m = nullptr; + Address *a = nullptr; + Membership *m = nullptr; while (i.next(a,m)) { if (!f(*a,*m)) break; diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index 9828d589..74bed6fd 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -293,7 +293,7 @@ struct NetworkConfig return false; } - ZT_ALWAYS_INLINE Capability *capability(const uint32_t id) const + ZT_ALWAYS_INLINE const Capability *capability(const uint32_t id) const { for(unsigned int i=0;i #include +#include #include "../node/Constants.hpp" #include "../node/Hashtable.hpp" diff --git a/osdep/NeighborDiscovery.hpp b/osdep/NeighborDiscovery.hpp index 5abf3129..5d1a07b1 100644 --- a/osdep/NeighborDiscovery.hpp +++ b/osdep/NeighborDiscovery.hpp @@ -18,14 +18,10 @@ #include "../node/MAC.hpp" #include "../node/InetAddress.hpp" - #define ZT_ND_QUERY_INTERVAL 2000 - #define ZT_ND_QUERY_MAX_TTL 5000 - #define ZT_ND_EXPIRE 600000 - namespace ZeroTier { class NeighborDiscovery