Consolidation of multipath logic. Better system separation
This commit is contained in:
parent
19391858d4
commit
e1af003e4f
23 changed files with 2004 additions and 3162 deletions
|
@ -414,27 +414,6 @@ class Binder {
|
|||
}
|
||||
}
|
||||
|
||||
// Generate set of unique interface names (used for formation of logical link set in multipath code)
|
||||
// TODO: Could be gated not to run if multipath is not enabled.
|
||||
for (std::map<InetAddress, std::string>::const_iterator ii(localIfAddrs.begin()); ii != localIfAddrs.end(); ++ii) {
|
||||
linkIfNames.insert(ii->second);
|
||||
}
|
||||
for (std::set<std::string>::iterator si(linkIfNames.begin()); si != linkIfNames.end();) {
|
||||
bool bFoundMatch = false;
|
||||
for (std::map<InetAddress, std::string>::const_iterator ii(localIfAddrs.begin()); ii != localIfAddrs.end(); ++ii) {
|
||||
if (ii->second == *si) {
|
||||
bFoundMatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (! bFoundMatch) {
|
||||
linkIfNames.erase(si++);
|
||||
}
|
||||
else {
|
||||
++si;
|
||||
}
|
||||
}
|
||||
|
||||
// Create new bindings for those not already bound
|
||||
for (std::map<InetAddress, std::string>::const_iterator ii(localIfAddrs.begin()); ii != localIfAddrs.end(); ++ii) {
|
||||
unsigned int bi = 0;
|
||||
|
@ -535,14 +514,7 @@ class Binder {
|
|||
return false;
|
||||
}
|
||||
|
||||
inline std::set<std::string> getLinkInterfaceNames()
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
return linkIfNames;
|
||||
}
|
||||
|
||||
private:
|
||||
std::set<std::string> linkIfNames;
|
||||
_Binding _bindings[ZT_BINDER_MAX_BINDINGS];
|
||||
std::atomic<unsigned int> _bindingCount;
|
||||
Mutex _lock;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue