From c3bfcf560b1db720c9bb08021b50bd31094e737c Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Wed, 12 Jun 2019 13:14:14 -0700 Subject: [PATCH 1/5] Removed check for port number in multipath path replacement logic --- node/Peer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/Peer.cpp b/node/Peer.cpp index 95a260037..3357bb2ab 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -157,7 +157,7 @@ void Peer::received( break; } // If the path is the same address and port, simply assume this is a replacement - if ( (_paths[i].p->address().ipsEqual2(path->address()) && (_paths[i].p->address().port() == path->address().port()))) { + if ( (_paths[i].p->address().ipsEqual2(path->address()))) { replacePath = i; break; } From f411eb1651bbfaa276eab02cf368e9fcb3905a15 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 13 Jun 2019 10:15:45 -0700 Subject: [PATCH 2/5] Remove old RethinkDB.cpp/.hpp files from visual studio project --- windows/ZeroTierOne/ZeroTierOne.vcxproj | 2 -- windows/ZeroTierOne/ZeroTierOne.vcxproj.filters | 6 ------ 2 files changed, 8 deletions(-) diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index 8e08d3fb4..60c87d3b5 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -30,7 +30,6 @@ - @@ -115,7 +114,6 @@ - diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters index 22f8aa3eb..f7df20343 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj.filters @@ -258,9 +258,6 @@ Source Files\controller - - Source Files\controller - @@ -494,9 +491,6 @@ Header Files\controller - - Header Files\controller - Header Files\node From 47d29ddcaf677a5376f54e6901bcdc38e499b16d Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 13 Jun 2019 10:27:54 -0700 Subject: [PATCH 3/5] Compiler warning cleanup --- node/Node.cpp | 2 +- node/Path.hpp | 4 ++-- node/Peer.cpp | 10 +++++----- node/RingBuffer.hpp | 2 +- node/Switch.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/node/Node.cpp b/node/Node.cpp index c9f38ad30..237da4633 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -500,7 +500,7 @@ ZT_PeerList *Node::peers() const p->paths[p->pathCount].trustedPathId = RR->topology->getOutboundPathTrust((*path)->address()); p->paths[p->pathCount].expired = 0; p->paths[p->pathCount].preferred = ((*path) == bestp) ? 1 : 0; - p->paths[p->pathCount].latency = (*path)->latency(); + p->paths[p->pathCount].latency = (float)(*path)->latency(); p->paths[p->pathCount].packetDelayVariance = (*path)->packetDelayVariance(); p->paths[p->pathCount].throughputDisturbCoeff = (*path)->throughputDisturbanceCoefficient(); p->paths[p->pathCount].packetErrorRatio = (*path)->packetErrorRatio(); diff --git a/node/Path.hpp b/node/Path.hpp index e1e65cb46..5b966f6b8 100644 --- a/node/Path.hpp +++ b/node/Path.hpp @@ -351,7 +351,7 @@ public: _unackedBytes = (ackedBytes > _unackedBytes) ? 0 : _unackedBytes - ackedBytes; int64_t timeSinceThroughputEstimate = (now - _lastThroughputEstimation); if (timeSinceThroughputEstimate >= ZT_PATH_THROUGHPUT_MEASUREMENT_INTERVAL) { - uint64_t throughput = (float)(_bytesAckedSinceLastThroughputEstimation * 8) / ((float)timeSinceThroughputEstimate / (float)1000); + uint64_t throughput = (uint64_t)((float)(_bytesAckedSinceLastThroughputEstimation * 8) / ((float)timeSinceThroughputEstimate / (float)1000)); _throughputSamples.push(throughput); _maxLifetimeThroughput = throughput > _maxLifetimeThroughput ? throughput : _maxLifetimeThroughput; _lastThroughputEstimation = now; @@ -416,7 +416,7 @@ public: if (it != _outQoSRecords.end()) { uint16_t rtt = (uint16_t)(now - it->second); uint16_t rtt_compensated = rtt - rx_ts[j]; - float latency = rtt_compensated / 2.0; + uint16_t latency = rtt_compensated / 2; updateLatency(latency, now); _outQoSRecords.erase(it); } diff --git a/node/Peer.cpp b/node/Peer.cpp index a0b0c1c4c..029e45e71 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -285,7 +285,7 @@ void Peer::computeAggregateProportionalAllocation(int64_t now) for(unsigned int i=0;ilastComputedStability(); - relThroughput[i] = _paths[i].p->maxLifetimeThroughput(); + relThroughput[i] = (float)_paths[i].p->maxLifetimeThroughput(); maxStability = relStability[i] > maxStability ? relStability[i] : maxStability; maxThroughput = relThroughput[i] > maxThroughput ? relThroughput[i] : maxThroughput; maxScope = _paths[i].p->ipScope() > maxScope ? _paths[i].p->ipScope() : maxScope; @@ -296,7 +296,7 @@ void Peer::computeAggregateProportionalAllocation(int64_t now) if (_paths[i].p) { relStability[i] /= maxStability ? maxStability : 1; relThroughput[i] /= maxThroughput ? maxThroughput : 1; - float normalized_ma = Utils::normalize(_paths[i].p->ackAge(now), 0, ZT_PATH_MAX_AGE, 0, 10); + float normalized_ma = Utils::normalize((float)_paths[i].p->ackAge(now), 0, ZT_PATH_MAX_AGE, 0, 10); float age_contrib = exp((-1)*normalized_ma); float relScope = ((float)(_paths[i].p->ipScope()+1) / (maxScope + 1)); float relQuality = @@ -314,7 +314,7 @@ void Peer::computeAggregateProportionalAllocation(int64_t now) // Convert set of relative performances into an allocation set for(uint16_t i=0;iupdateComponentAllocationOfAggregateLink((_paths[i].p->relativeQuality() / totalRelativeQuality) * 255); + _paths[i].p->updateComponentAllocationOfAggregateLink((unsigned char)((_paths[i].p->relativeQuality() / totalRelativeQuality) * 255)); } } } @@ -327,7 +327,7 @@ int Peer::computeAggregateLinkPacketDelayVariance() pdv += _paths[i].p->relativeQuality() * _paths[i].p->packetDelayVariance(); } } - return pdv; + return (int)pdv; } int Peer::computeAggregateLinkMeanLatency() @@ -337,7 +337,7 @@ int Peer::computeAggregateLinkMeanLatency() for(unsigned int i=0;irelativeQuality() * _paths[i].p->meanLatency(); + ml += (int)(_paths[i].p->relativeQuality() * _paths[i].p->meanLatency()); } } return ml / pathCount; diff --git a/node/RingBuffer.hpp b/node/RingBuffer.hpp index 8b11e9b1b..0f29a89a9 100644 --- a/node/RingBuffer.hpp +++ b/node/RingBuffer.hpp @@ -268,7 +268,7 @@ public: for (size_t i=0; i &network, Packet & uint64_t Switch::control_law(uint64_t t, int count) { - return t + ZT_QOS_INTERVAL / sqrt(count); + return (uint64_t)(t + ZT_QOS_INTERVAL / sqrt(count)); } Switch::dqr Switch::dodequeue(ManagedQueue *q, uint64_t now) From eb84d61debd267b3446cd2f1a36d7f4fd354674a Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 13 Jun 2019 10:35:54 -0700 Subject: [PATCH 4/5] remove these from jenkins for now --- Jenkinsfile | 62 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e729c3345..9e9cb51a7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,42 +24,42 @@ parallel 'centos7': { throw err } } -}, 'android-ndk': { - node('android-ndk') { - try { - checkout scm +// }, 'android-ndk': { +// node('android-ndk') { +// try { +// checkout scm - stage('Build Android NDK') { - sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}" - } - } - catch (err) { - currentBuild.result = "FAILURE" - mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)" +// stage('Build Android NDK') { +// sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}" +// } +// } +// catch (err) { +// currentBuild.result = "FAILURE" +// mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)" - throw err - } - } -}, 'macOS': { - node('macOS') { - try { - checkout scm +// throw err +// } +// } +// }, 'macOS': { +// node('macOS') { +// try { +// checkout scm - stage('Build macOS') { - sh 'make -f make-mac.mk' - } +// stage('Build macOS') { +// sh 'make -f make-mac.mk' +// } - stage('Build macOS UI') { - sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug' - } - } - catch (err) { - currentBuild.result = "FAILURE" - mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)" +// stage('Build macOS UI') { +// sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug' +// } +// } +// catch (err) { +// currentBuild.result = "FAILURE" +// mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)" - throw err - } - } +// throw err +// } +// } }, 'windows': { node('windows') { try { From 3b188ba672559ff80264a8fab32699ebdbf928fe Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Thu, 13 Jun 2019 10:38:42 -0700 Subject: [PATCH 5/5] no message --- Jenkinsfile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9e9cb51a7..88989327e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,25 +60,25 @@ parallel 'centos7': { // throw err // } // } -}, 'windows': { - node('windows') { - try { - checkout scm +// }, 'windows': { +// node('windows') { +// try { +// checkout scm - stage('Build Windows') { - bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64 -git clean -dfx -msbuild windows\\ZeroTierOne.sln -''' - } - } - catch (err) { - currentBuild.result = "FAILURE" - mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)" +// stage('Build Windows') { +// bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64 +// git clean -dfx +// msbuild windows\\ZeroTierOne.sln +// ''' +// } +// } +// catch (err) { +// currentBuild.result = "FAILURE" +// mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)" - throw err - } - } +// throw err +// } +// } } mattermostSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"