Fix bad index bug (during switching) in balance-rr

This commit is contained in:
Joseph Henry 2021-09-07 21:41:54 -07:00
parent b6ed919fbc
commit e607348c7e
No known key found for this signature in database
GPG key ID: C45B33FF5EBC9344

View file

@ -314,7 +314,7 @@ SharedPtr<Path> Bond::getAppropriatePath(int64_t now, int32_t flowId)
}
// Reset striping counter
_rrPacketsSentOnCurrLink = 0;
if (_numBondedPaths == 1) {
if (_numBondedPaths == 1 || _rrIdx >= (ZT_MAX_PEER_NETWORK_PATHS-1)) {
_rrIdx = 0;
}
else {
@ -1654,7 +1654,7 @@ void Bond::setBondParameters(int policy, SharedPtr<Bond> templateBond, bool useT
// rr
_rrPacketsSentOnCurrLink = 0;
_rrIdx = ZT_MAX_PEER_NETWORK_PATHS;
_rrIdx = 0;
// General parameters