From 3ead6b67cd2cf540ce51add2a2d425a1662decf8 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Wed, 2 Mar 2022 14:58:31 -0800 Subject: [PATCH] Dynamically scale bonded link monitor frequency according to aliveness --- node/Bond.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/Bond.cpp b/node/Bond.cpp index f1488a8ea..e58c67297 100644 --- a/node/Bond.cpp +++ b/node/Bond.cpp @@ -768,7 +768,7 @@ void Bond::processBackgroundBondTasks(void* tPtr, int64_t now) for (unsigned int i = 0; i < ZT_MAX_PEER_NETWORK_PATHS; ++i) { if (_paths[i].p && _paths[i].allowed()) { if (_isLeaf) { - if ((_monitorInterval > 0) && (((now - _paths[i].p->_lastIn) >= _monitorInterval) /*|| ((now - _paths[i].p->_lastOut) >= _monitorInterval)*/)) { + if ((_monitorInterval > 0) && (((now - _paths[i].p->_lastIn) >= (_paths[i].alive ? _monitorInterval : _failoverInterval)))) { if ((_peer->remoteVersionProtocol() >= 5) && (! ((_peer->remoteVersionMajor() == 1) && (_peer->remoteVersionMinor() == 1) && (_peer->remoteVersionRevision() == 0)))) { Packet outp(_peer->address(), RR->identity.address(), Packet::VERB_ECHO); // ECHO (this is our bond's heartbeat) outp.armor(_peer->key(), true, _peer->aesKeysIfSupported());