Fix multipath flow reallocation. Prevent allocation to dead paths

This commit is contained in:
Joseph Henry 2021-12-08 14:32:58 -08:00
parent 983336911c
commit 05a0a20197
No known key found for this signature in database
GPG Key ID: C45B33FF5EBC9344

View File

@ -894,13 +894,13 @@ void Bond::curateBond(int64_t now, bool rebuildBond)
if (! currEligibility) {
_paths[i].adjustRefractoryPeriod(now, _defaultPathRefractoryPeriod, ! currEligibility);
if (_paths[i].bonded) {
_paths[i].bonded = false;
if (_allowFlowHashing) {
_paths[i].p->address().toString(pathStr);
log("link %s/%s was bonded, flow reallocation will occur soon", getLink(_paths[i].p)->ifname().c_str(), pathStr);
rebuildBond = true;
_paths[i].shouldReallocateFlows = _paths[i].bonded;
}
_paths[i].bonded = false;
}
}
}
@ -979,7 +979,7 @@ void Bond::curateBond(int64_t now, bool rebuildBond)
if (ipvPref == 0) {
for (int j = 0; j < it->second.size(); j++) {
int idx = it->second.at(j);
if (! _paths[idx].p || ! _paths[idx].allowed()) {
if (! _paths[idx].p || ! _paths[idx].eligible || ! _paths[idx].allowed()) {
continue;
}
addPathToBond(idx, updatedBondedPathCount);
@ -992,7 +992,7 @@ void Bond::curateBond(int64_t now, bool rebuildBond)
if (ipvPref == 4 || ipvPref == 6) {
for (int j = 0; j < it->second.size(); j++) {
int idx = it->second.at(j);
if (! _paths[idx].p) {
if (! _paths[idx].p || ! _paths[idx].eligible) {
continue;
}
if (! _paths[idx].allowed()) {
@ -1000,9 +1000,6 @@ void Bond::curateBond(int64_t now, bool rebuildBond)
log("did not add %s/%s (user addr preference %d)", link->ifname().c_str(), pathStr, ipvPref);
continue;
}
if (! _paths[idx].eligible) {
continue;
}
addPathToBond(idx, updatedBondedPathCount);
++updatedBondedPathCount;
_paths[idx].p->address().toString(pathStr);
@ -1016,10 +1013,10 @@ void Bond::curateBond(int64_t now, bool rebuildBond)
// Search for preferred paths
for (int j = 0; j < it->second.size(); j++) {
int idx = it->second.at(j);
if (! _paths[idx].p || ! _paths[idx].eligible) {
if (! _paths[idx].p || ! _paths[idx].eligible || ! _paths[idx].allowed()) {
continue;
}
if (_paths[idx].preferred() && _paths[idx].allowed()) {
if (_paths[idx].preferred()) {
addPathToBond(idx, updatedBondedPathCount);
++updatedBondedPathCount;
_paths[idx].p->address().toString(pathStr);