File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -445,11 +445,21 @@ void Peer::tryMemorizedPath(void *tPtr,int64_t now)
445
445
void Peer::performMultipathStateCheck (void *tPtr, int64_t now)
446
446
{
447
447
Mutex::Lock _l (_bond_m);
448
+ if (_bond) {
449
+ // Once enabled the Bond object persists, no need to update state
450
+ return ;
451
+ }
448
452
/* *
449
453
* Check for conditions required for multipath bonding and create a bond
450
454
* if allowed.
451
455
*/
452
- _localMultipathSupported = ((RR->bc ->inUse ()) && (ZT_PROTO_VERSION > 9 ));
456
+ int numAlivePaths = 0 ;
457
+ for (unsigned int i=0 ;i<ZT_MAX_PEER_NETWORK_PATHS;++i) {
458
+ if (_paths[i].p && _paths[i].p ->alive (now)) {
459
+ numAlivePaths++;
460
+ }
461
+ }
462
+ _localMultipathSupported = ((numAlivePaths >= 1 ) && (RR->bc ->inUse ()) && (ZT_PROTO_VERSION > 9 ));
453
463
if (_localMultipathSupported && !_bond) {
454
464
if (RR->bc ) {
455
465
_bond = RR->bc ->createTransportTriggeredBond (RR, this );
You can’t perform that action at this time.
0 commit comments