From f6ced547be10ba6c64696e145a8306ff66da7d1b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 31 Jul 2015 08:56:31 -0700 Subject: Dead code removal. --- node/Node.hpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'node') diff --git a/node/Node.hpp b/node/Node.hpp index 0e966aa6..2a283eab 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -248,9 +248,6 @@ private: ZT1_VirtualNetworkConfigFunction _virtualNetworkConfigFunction; ZT1_EventCallback _eventCallback; - //Dictionary _localConfig; // persisted as local.conf - //Mutex _localConfig_m; - std::vector< std::pair< uint64_t, SharedPtr > > _networks; Mutex _networks_m; -- cgit v1.2.3 From 8d09c37140ef589d9e23993e20a080936b90a7aa Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 31 Jul 2015 09:37:13 -0700 Subject: Remove a bit of redundant logic, and also announce MULTICAST_LIKEs to controllers (for future use). --- node/Network.cpp | 2 +- node/Peer.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'node') diff --git a/node/Network.cpp b/node/Network.cpp index 549219d7..8922483d 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -533,7 +533,7 @@ public: inline void operator()(Topology &t,const SharedPtr &p) { - if ( ( (p->hasActiveDirectPath(_now)) && (_network->_isAllowed(p->address())) ) || (std::find(_rootAddresses.begin(),_rootAddresses.end(),p->address()) != _rootAddresses.end()) ) { + if ( ( (p->hasActiveDirectPath(_now)) && ( (_network->_isAllowed(p->address())) || (p->address() == _network->controller()) ) || (std::find(_rootAddresses.begin(),_rootAddresses.end(),p->address()) != _rootAddresses.end()) ) { Packet outp(p->address(),RR->identity.address(),Packet::VERB_MULTICAST_LIKE); for(std::vector::iterator mg(_allMulticastGroups.begin());mg!=_allMulticastGroups.end();++mg) { diff --git a/node/Peer.cpp b/node/Peer.cpp index 3cf0ec4e..c27afa8f 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -133,7 +133,7 @@ void Peer::received( Packet outp(_id.address(),RR->identity.address(),Packet::VERB_MULTICAST_LIKE); const std::vector< SharedPtr > networks(RR->node->allNetworks()); for(std::vector< SharedPtr >::const_iterator n(networks.begin());n!=networks.end();++n) { - if ( (isRoot) || ((*n)->isAllowed(_id.address())) ) { + if ( (isRoot) || ((*n)->isAllowed(_id.address())) || (_id.address() == (*n)->controller()) ) { const std::vector mgs((*n)->allMulticastGroups()); for(std::vector::const_iterator mg(mgs.begin());mg!=mgs.end();++mg) { if ((outp.size() + 18) > ZT_UDP_DEFAULT_PAYLOAD_MTU) { @@ -211,7 +211,7 @@ void Peer::attemptToContactAt(const RuntimeEnvironment *RR,const InetAddress &at void Peer::doPingAndKeepalive(const RuntimeEnvironment *RR,uint64_t now) { RemotePath *const bestPath = getBestPath(now); - if ((bestPath)&&(bestPath->active(now))) { + if (bestPath) { if ((now - bestPath->lastReceived()) >= ZT_PEER_DIRECT_PING_DELAY) { TRACE("PING %s(%s)",_id.address().toString().c_str(),bestPath->address().toString().c_str()); attemptToContactAt(RR,bestPath->address(),now); @@ -239,7 +239,7 @@ void Peer::pushDirectPaths(const RuntimeEnvironment *RR,RemotePath *path,uint64_ ps.push_back(','); ps.append(p->address().toString()); } - TRACE("pushing %u direct paths (local interface addresses) to %s: %s",(unsigned int)dps.size(),_id.address().toString().c_str(),ps.c_str()); + TRACE("pushing %u direct paths to %s: %s",(unsigned int)dps.size(),_id.address().toString().c_str(),ps.c_str()); } #endif -- cgit v1.2.3 From facb009a1dbed53ac722180aec1250bbe6334001 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 31 Jul 2015 09:50:55 -0700 Subject: Add security notice to auto-update info in -h output, and fix a missing paren. --- node/Network.cpp | 2 +- one.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'node') diff --git a/node/Network.cpp b/node/Network.cpp index 8922483d..39042fab 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -533,7 +533,7 @@ public: inline void operator()(Topology &t,const SharedPtr &p) { - if ( ( (p->hasActiveDirectPath(_now)) && ( (_network->_isAllowed(p->address())) || (p->address() == _network->controller()) ) || (std::find(_rootAddresses.begin(),_rootAddresses.end(),p->address()) != _rootAddresses.end()) ) { + if ( ( (p->hasActiveDirectPath(_now)) && ( (_network->_isAllowed(p->address())) || (p->address() == _network->controller()) ) ) || (std::find(_rootAddresses.begin(),_rootAddresses.end(),p->address()) != _rootAddresses.end()) ) { Packet outp(p->address(),RR->identity.address(),Packet::VERB_MULTICAST_LIKE); for(std::vector::iterator mg(_allMulticastGroups.begin());mg!=_allMulticastGroups.end();++mg) { diff --git a/one.cpp b/one.cpp index f5cf9c00..30d95cb9 100644 --- a/one.cpp +++ b/one.cpp @@ -904,7 +904,7 @@ static void printHelp(const char *cn,FILE *out) fprintf(out,"Licensed under the GNU General Public License v3"ZT_EOL_S""ZT_EOL_S); std::string updateUrl(OneService::autoUpdateUrl()); if (updateUrl.length()) - fprintf(out,"Automatic update enabled:"ZT_EOL_S" %s"ZT_EOL_S""ZT_EOL_S,updateUrl.c_str()); + fprintf(out,"Automatic updates enabled:"ZT_EOL_S" %s"ZT_EOL_S" (all updates are securely authenticated by 256-bit ECDSA signature)"ZT_EOL_S""ZT_EOL_S,updateUrl.c_str()); fprintf(out,"Usage: %s [-switches] [home directory]"ZT_EOL_S""ZT_EOL_S,cn); fprintf(out,"Available switches:"ZT_EOL_S); fprintf(out," -h - Display this help"ZT_EOL_S); -- cgit v1.2.3