diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-01 10:22:57 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-01 10:22:57 -0800 |
| commit | 2bf9145ae65385bf968542619ffcf204cf6241d8 (patch) | |
| tree | b97d30342ef7c34fe0a1b236635d78ec29ed40d9 /node/Switch.cpp | |
| parent | 127bcb02ffd09b522678c7e50aae21a1ecd87e4e (diff) | |
| download | infinitytier-2bf9145ae65385bf968542619ffcf204cf6241d8.tar.gz infinitytier-2bf9145ae65385bf968542619ffcf204cf6241d8.zip | |
Outgoing side of packet counter for link quality reporting. Also some cleanup and a cluster mode build fix.
Diffstat (limited to 'node/Switch.cpp')
| -rw-r--r-- | node/Switch.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index 346091a4..bf309e36 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -88,7 +88,7 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from if ((now - _lastBeaconResponse) >= 2500) { // limit rate of responses _lastBeaconResponse = now; Packet outp(peer->address(),RR->identity.address(),Packet::VERB_NOP); - outp.armor(peer->key(),true); + outp.armor(peer->key(),true,path->nextOutgoingCounter()); path->send(RR,outp.data(),outp.size(),now); } } @@ -777,7 +777,7 @@ bool Switch::_trySend(Packet &packet,bool encrypt) if ((clusterMostRecentMemberId < 0)||(viaPath->lastIn() > clusterMostRecentTs)) { #endif if ((now - viaPath->lastOut()) > std::max((now - viaPath->lastIn()) * 4,(uint64_t)ZT_PATH_MIN_REACTIVATE_INTERVAL)) { - peer->attemptToContactAt(viaPath->localAddress(),viaPath->address(),now,false); + peer->attemptToContactAt(viaPath->localAddress(),viaPath->address(),now,false,viaPath->nextOutgoingCounter()); viaPath->sent(now); } #ifdef ZT_ENABLE_CLUSTER @@ -825,14 +825,14 @@ bool Switch::_trySend(Packet &packet,bool encrypt) if (trustedPathId) { packet.setTrusted(trustedPathId); } else { - packet.armor((clusterMostRecentMemberId >= 0) ? clusterPeerSecret : peer->key(),encrypt); + packet.armor((clusterMostRecentMemberId >= 0) ? clusterPeerSecret : peer->key(),encrypt,(viaPath) ? viaPath->nextOutgoingCounter() : 0); } #else const uint64_t trustedPathId = RR->topology->getOutboundPathTrust(viaPath->address()); if (trustedPathId) { packet.setTrusted(trustedPathId); } else { - packet.armor(peer->key(),encrypt); + packet.armor(peer->key(),encrypt,viaPath->nextOutgoingCounter()); } #endif |
