diff --git a/root/root.cpp b/root/root.cpp index d1c186a13..aa3ba4506 100644 --- a/root/root.cpp +++ b/root/root.cpp @@ -60,6 +60,7 @@ #include #include #include +#include using namespace ZeroTier; @@ -72,6 +73,7 @@ struct PeerInfo struct AddressHasher { ZT_ALWAYS_INLINE std::size_t operator()(const Address &a) const { return (std::size_t)a.toInt(); } }; struct InetAddressHasher { ZT_ALWAYS_INLINE std::size_t operator()(const InetAddress &ip) const { return (std::size_t)ip.hashCode(); } }; +static std::atomic_bool run; static std::unordered_map< Address,std::map< Identity,PeerInfo >,AddressHasher > peersByVirtAddr; static std::unordered_map< InetAddress,std::map< Identity,PeerInfo >,InetAddressHasher > peersByPhysAddr; static Mutex peersByVirtAddr_l; @@ -133,6 +135,8 @@ int main(int argc,char **argv) unsigned int ncores = std::thread::hardware_concurrency(); if (ncores == 0) ncores = 1; + run = true; + std::vector sockets; std::vector threads; for(unsigned int tn=0;tn