mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Fix segfault during balance-rr when link is brought down
This commit is contained in:
parent
a8f830aa9c
commit
5e122b95e7
1 changed files with 5 additions and 4 deletions
|
@ -135,13 +135,14 @@ SharedPtr<Path> Bond::getAppropriatePath(int64_t now, int32_t flowId)
|
||||||
int _tempIdx = _rrIdx;
|
int _tempIdx = _rrIdx;
|
||||||
for (int searchCount = 0; searchCount < (_numBondedPaths-1); searchCount++) {
|
for (int searchCount = 0; searchCount < (_numBondedPaths-1); searchCount++) {
|
||||||
_tempIdx = (_tempIdx == (_numBondedPaths-1)) ? 0 : _tempIdx+1;
|
_tempIdx = (_tempIdx == (_numBondedPaths-1)) ? 0 : _tempIdx+1;
|
||||||
if (_paths[_bondedIdx[_tempIdx]] && _paths[_bondedIdx[_tempIdx]]->eligible(now,_ackSendInterval)) {
|
if (_bondedIdx[_tempIdx] != ZT_MAX_PEER_NETWORK_PATHS) {
|
||||||
_rrIdx = _tempIdx;
|
if (_paths[_bondedIdx[_tempIdx]] && _paths[_bondedIdx[_tempIdx]]->eligible(now,_ackSendInterval)) {
|
||||||
break;
|
_rrIdx = _tempIdx;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "_rrIdx=%d\n", _rrIdx);
|
|
||||||
if (_paths[_bondedIdx[_rrIdx]]) {
|
if (_paths[_bondedIdx[_rrIdx]]) {
|
||||||
return _paths[_bondedIdx[_rrIdx]];
|
return _paths[_bondedIdx[_rrIdx]];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue