From b6ed919fbcaa6356854bc5b2e5dd059617f21a2c Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 7 Sep 2021 13:44:02 -0700 Subject: [PATCH] Call recordOutgoingPacket regardless of policy to generate sufficient entropy for bond layer --- node/Bond.cpp | 1 - node/Constants.hpp | 2 +- node/Peer.cpp | 15 ++++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/node/Bond.cpp b/node/Bond.cpp index d0678a447..77dd007a8 100644 --- a/node/Bond.cpp +++ b/node/Bond.cpp @@ -1784,7 +1784,6 @@ void Bond::dumpInfo(int64_t now, bool force) dumpPathStatus(now, i); } } - fprintf(stderr, "\n\n\n"); } } // namespace ZeroTier diff --git a/node/Constants.hpp b/node/Constants.hpp index 859fc2b66..5d63f4f28 100644 --- a/node/Constants.hpp +++ b/node/Constants.hpp @@ -549,7 +549,7 @@ /** * How often we emit a bond summary for each bond */ -#define ZT_BOND_STATUS_INTERVAL 3000 +#define ZT_BOND_STATUS_INTERVAL 30000 /** * How long before we consider a path to be dead in the general sense. This is diff --git a/node/Peer.cpp b/node/Peer.cpp index 6e8702742..f5d4519a4 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -573,27 +573,24 @@ void Peer::resetWithinScope(void *tPtr,InetAddress::IpScope scope,int inetAddres void Peer::recordOutgoingPacket(const SharedPtr &path, const uint64_t packetId, uint16_t payloadLength, const Packet::Verb verb, const int32_t flowId, int64_t now) { - if (!_shouldCollectPathStatistics || !_bond) { - return; + if (_localMultipathSupported && _bond) { + _bond->recordOutgoingPacket(path, packetId, payloadLength, verb, flowId, now); } - _bond->recordOutgoingPacket(path, packetId, payloadLength, verb, flowId, now); } void Peer::recordIncomingInvalidPacket(const SharedPtr& path) { - if (!_shouldCollectPathStatistics || !_bond) { - return; + if (_localMultipathSupported && _bond) { + _bond->recordIncomingInvalidPacket(path); } - _bond->recordIncomingInvalidPacket(path); } void Peer::recordIncomingPacket(const SharedPtr &path, const uint64_t packetId, uint16_t payloadLength, const Packet::Verb verb, const int32_t flowId, int64_t now) { - if (!_shouldCollectPathStatistics || !_bond) { - return; + if (_localMultipathSupported && _bond) { + _bond->recordIncomingPacket(path, packetId, payloadLength, verb, flowId, now); } - _bond->recordIncomingPacket(path, packetId, payloadLength, verb, flowId, now); } } // namespace ZeroTier