mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-21 13:57:49 +00:00
Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev
This commit is contained in:
commit
df640dc39b
@ -362,7 +362,8 @@ bool Bond::assignFlowToBondedPath(SharedPtr<Flow> &flow, int64_t now)
|
||||
if (_bondingPolicy == ZT_BONDING_POLICY_BALANCE_XOR) {
|
||||
idx = abs((int)(flow->id() % (_numBondedPaths)));
|
||||
SharedPtr<Link> link = RR->bc->getLinkBySocket(_policyAlias, _paths[_bondedIdx[idx]]->localSocket());
|
||||
sprintf(traceMsg, "%s (balance-xor) Assigned outgoing flow %x to peer %llx to link %s/%s, %lu active flow(s)\n",
|
||||
_paths[_bondedIdx[idx]]->address().toString(curPathStr);
|
||||
sprintf(traceMsg, "%s (balance-xor) Assigned outgoing flow %x to peer %llx to link %s/%s, %lu active flow(s)",
|
||||
OSUtils::humanReadableTimestamp().c_str(), flow->id(), _peer->_id.address().toInt(), link->ifname().c_str(), curPathStr, _flows.size());
|
||||
RR->t->bondStateMessage(NULL, traceMsg);
|
||||
flow->assignPath(_paths[_bondedIdx[idx]],now);
|
||||
@ -417,7 +418,7 @@ bool Bond::assignFlowToBondedPath(SharedPtr<Flow> &flow, int64_t now)
|
||||
}
|
||||
flow->assignedPath()->address().toString(curPathStr);
|
||||
SharedPtr<Link> link = RR->bc->getLinkBySocket(_policyAlias, flow->assignedPath()->localSocket());
|
||||
sprintf(traceMsg, "%s (bond) Assigned outgoing flow %x to peer %llx to link %s/%s, %lu active flow(s)\n",
|
||||
sprintf(traceMsg, "%s (bond) Assigned outgoing flow %x to peer %llx to link %s/%s, %lu active flow(s)",
|
||||
OSUtils::humanReadableTimestamp().c_str(), flow->id(), _peer->_id.address().toInt(), link->ifname().c_str(), curPathStr, _flows.size());
|
||||
RR->t->bondStateMessage(NULL, traceMsg);
|
||||
return true;
|
||||
@ -452,7 +453,7 @@ SharedPtr<Flow> Bond::createFlow(const SharedPtr<Path> &path, int32_t flowId, un
|
||||
path->address().toString(curPathStr);
|
||||
path->_assignedFlowCount++;
|
||||
SharedPtr<Link> link = RR->bc->getLinkBySocket(_policyAlias, flow->assignedPath()->localSocket());
|
||||
sprintf(traceMsg, "%s (bond) Assigned incoming flow %x from peer %llx to link %s/%s, %lu active flow(s)\n",
|
||||
sprintf(traceMsg, "%s (bond) Assigned incoming flow %x from peer %llx to link %s/%s, %lu active flow(s)",
|
||||
OSUtils::humanReadableTimestamp().c_str(), flow->id(), _peer->_id.address().toInt(), link->ifname().c_str(), curPathStr, _flows.size());
|
||||
RR->t->bondStateMessage(NULL, traceMsg);
|
||||
}
|
||||
@ -475,7 +476,7 @@ void Bond::forgetFlowsWhenNecessary(uint64_t age, bool oldest, int64_t now)
|
||||
if (age) { // Remove by specific age
|
||||
while (it != _flows.end()) {
|
||||
if (it->second->age(now) > age) {
|
||||
sprintf(traceMsg, "%s (bond) Forgetting flow %x between this node and peer %llx, %lu active flow(s)\n",
|
||||
sprintf(traceMsg, "%s (bond) Forgetting flow %x between this node and peer %llx, %lu active flow(s)",
|
||||
OSUtils::humanReadableTimestamp().c_str(), it->first, _peer->_id.address().toInt(), (_flows.size()-1));
|
||||
RR->t->bondStateMessage(NULL, traceMsg);
|
||||
it->second->assignedPath()->_assignedFlowCount--;
|
||||
@ -495,7 +496,7 @@ void Bond::forgetFlowsWhenNecessary(uint64_t age, bool oldest, int64_t now)
|
||||
++it;
|
||||
}
|
||||
if (oldestFlow != _flows.end()) {
|
||||
sprintf(traceMsg, "%s (bond) Forgetting oldest flow %x (of age %llu) between this node and peer %llx, %lu active flow(s)\n",
|
||||
sprintf(traceMsg, "%s (bond) Forgetting oldest flow %x (of age %llu) between this node and peer %llx, %lu active flow(s)",
|
||||
OSUtils::humanReadableTimestamp().c_str(), oldestFlow->first, oldestFlow->second->age(now), _peer->_id.address().toInt(), (_flows.size()-1));
|
||||
RR->t->bondStateMessage(NULL, traceMsg);
|
||||
oldestFlow->second->assignedPath()->_assignedFlowCount--;
|
||||
|
@ -396,7 +396,7 @@
|
||||
/**
|
||||
* How often we emit a one-liner bond summary for each peer
|
||||
*/
|
||||
#define ZT_MULTIPATH_BOND_STATUS_INTERVAL 30000
|
||||
#define ZT_MULTIPATH_BOND_STATUS_INTERVAL 60000
|
||||
|
||||
/**
|
||||
* How long before we consider a path to be dead in the general sense. This is
|
||||
@ -414,7 +414,7 @@
|
||||
* How long before we consider a flow to be dead and remove it from the
|
||||
* policy's list.
|
||||
*/
|
||||
#define ZT_MULTIPATH_FLOW_EXPIRATION_INTERVAL 30000
|
||||
#define ZT_MULTIPATH_FLOW_EXPIRATION_INTERVAL (60000 * 5)
|
||||
|
||||
/**
|
||||
* How often a flow's statistical counters are reset
|
||||
|
Loading…
Reference in New Issue
Block a user