diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-02-02 16:40:57 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-02-02 16:40:57 -0800 |
commit | b7148c107d04ba7b71577c764e88a02098d23480 (patch) | |
tree | c5f7026b81ba58cb802fd52f053b010f39925acd | |
parent | b1bf3f68c327588132c55fe2fe913d3ec98c0b25 (diff) | |
download | infinitytier-b7148c107d04ba7b71577c764e88a02098d23480.tar.gz infinitytier-b7148c107d04ba7b71577c764e88a02098d23480.zip |
Rip out network environment fingerprint. This will be replaced by constant monitoring of actual external address surface.
-rw-r--r-- | node/Constants.hpp | 5 | ||||
-rw-r--r-- | node/Node.cpp | 13 | ||||
-rw-r--r-- | node/RoutingTable.cpp | 35 | ||||
-rw-r--r-- | node/RoutingTable.hpp | 10 |
4 files changed, 0 insertions, 63 deletions
diff --git a/node/Constants.hpp b/node/Constants.hpp index 58a8dbea..beb66ab3 100644 --- a/node/Constants.hpp +++ b/node/Constants.hpp @@ -275,11 +275,6 @@ #define ZT_PING_CHECK_DELAY 10000 /** - * Delay between checks of network configuration fingerprint - */ -#define ZT_NETWORK_FINGERPRINT_CHECK_DELAY 5000 - -/** * Delay between ordinary case pings of direct links */ #define ZT_PEER_DIRECT_PING_DELAY 120000 diff --git a/node/Node.cpp b/node/Node.cpp index b9f027e3..8999642b 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -391,7 +391,6 @@ Node::ReasonForTermination Node::run() uint64_t lastNetworkAutoconfCheck = Utils::now() - 5000ULL; // check autoconf again after 5s for startup uint64_t lastPingCheck = 0; uint64_t lastClean = Utils::now(); // don't need to do this immediately - uint64_t lastNetworkFingerprintCheck = 0; uint64_t lastMulticastCheck = 0; uint64_t lastSupernodePingCheck = 0; uint64_t lastBeacon = 0; @@ -399,7 +398,6 @@ Node::ReasonForTermination Node::run() uint64_t lastShutdownIfUnreadableCheck = 0; long lastDelayDelta = 0; - uint64_t networkConfigurationFingerprint = 0; RR->timeOfLastResynchronize = Utils::now(); // We are up and running @@ -432,17 +430,6 @@ Node::ReasonForTermination Node::run() Thread::sleep(ZT_SLEEP_WAKE_SETTLE_TIME); } - // If our network environment looks like it changed, resynchronize. - if ((resynchronize)||((now - lastNetworkFingerprintCheck) >= ZT_NETWORK_FINGERPRINT_CHECK_DELAY)) { - lastNetworkFingerprintCheck = now; - uint64_t fp = RR->routingTable->networkEnvironmentFingerprint(RR->nc->networkTapDeviceNames()); - if (fp != networkConfigurationFingerprint) { - LOG("netconf fingerprint change: %.16llx != %.16llx, resyncing with network",networkConfigurationFingerprint,fp); - networkConfigurationFingerprint = fp; - resynchronize = true; - } - } - // Supernodes do not resynchronize unless explicitly ordered via SIGHUP. if ((resynchronize)&&(RR->topology->amSupernode())) resynchronize = false; diff --git a/node/RoutingTable.cpp b/node/RoutingTable.cpp index 2caafebe..6a5448a8 100644 --- a/node/RoutingTable.cpp +++ b/node/RoutingTable.cpp @@ -74,39 +74,4 @@ RoutingTable::~RoutingTable() { } -uint64_t RoutingTable::networkEnvironmentFingerprint(const std::vector<std::string> &ignoreInterfaces) const -{ - uint64_t fp = 0; - std::vector<Entry> rtab(get()); - for(std::vector<Entry>::const_iterator re(rtab.begin());re!=rtab.end();++re) { - bool skip = false; - for(std::vector<std::string>::const_iterator ii(ignoreInterfaces.begin());ii!=ignoreInterfaces.end();++ii) { - if (*ii == re->device) { - skip = true; - break; - } - } - if (skip) - continue; - ++fp; - if (re->destination.isV4()) { - fp = Utils::sdbmHash(re->destination.rawIpData(),4,fp); - fp = Utils::sdbmHash((uint16_t)re->destination.netmaskBits(),fp); - } else if (re->destination.isV6()) { - fp = Utils::sdbmHash(re->destination.rawIpData(),16,fp); - fp = Utils::sdbmHash((uint16_t)re->destination.netmaskBits(),fp); - } - if (re->gateway.isV4()) { - fp = Utils::sdbmHash(re->gateway.rawIpData(),4,fp); - fp = Utils::sdbmHash((uint16_t)re->gateway.netmaskBits(),fp); - } else if (re->gateway.isV6()) { - fp = Utils::sdbmHash(re->gateway.rawIpData(),16,fp); - fp = Utils::sdbmHash((uint16_t)re->gateway.netmaskBits(),fp); - } - fp = Utils::sdbmHash(re->device,fp); - fp = Utils::sdbmHash((uint32_t)re->metric,fp); - } - return fp; -} - } // namespace ZeroTier diff --git a/node/RoutingTable.hpp b/node/RoutingTable.hpp index c534f72c..a3faa79f 100644 --- a/node/RoutingTable.hpp +++ b/node/RoutingTable.hpp @@ -115,16 +115,6 @@ public: * @return Entry or null entry on failure (or delete) */ virtual RoutingTable::Entry set(const InetAddress &destination,const InetAddress &gateway,const char *device,int metric) = 0; - - /** - * Compute a 64-bit value that hashes the current state of the network environment - * - * This shouldn't be overridden -- uses get() to get underlying routing table. - * - * @param ignoreInterfaces Names of interfaces to exclude from fingerprint (e.g. my own) - * @return Integer CRC-type fingerprint of current network environment - */ - uint64_t networkEnvironmentFingerprint(const std::vector<std::string> &ignoreInterfaces) const; }; } // namespace ZeroTier |