diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-06-30 11:31:04 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-06-30 11:31:04 -0700 |
| commit | 88bdb81791e7879c6c199d6e9d03a326ec786484 (patch) | |
| tree | c22c9e36e803ba820c55ca04a82ba204ff906ade /node/Peer.cpp | |
| parent | 458f6ae7c37c7877a842e7931edc67d9fed201cd (diff) | |
| download | infinitytier-88bdb81791e7879c6c199d6e9d03a326ec786484.tar.gz infinitytier-88bdb81791e7879c6c199d6e9d03a326ec786484.zip | |
Keep track of basic aliveness for peers regardless if direct or indirect connectivity and use this for multicast propagation. Also consolidate adding of active bridges via the same functor as regular multicast next hops.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 54e30a74..e61631e2 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -35,6 +35,7 @@ namespace ZeroTier { Peer::Peer() : _lastUsed(0), + _lastReceive(0), _lastUnicastFrame(0), _lastMulticastFrame(0), _lastAnnouncedTo(0), @@ -47,6 +48,7 @@ Peer::Peer(const Identity &myIdentity,const Identity &peerIdentity) throw(std::runtime_error) : _id(peerIdentity), _lastUsed(0), + _lastReceive(0), _lastUnicastFrame(0), _lastMulticastFrame(0), _lastAnnouncedTo(0), @@ -73,6 +75,9 @@ void Peer::receive( // Update system-wide last packet receive time *((const_cast<uint64_t *>(&(_r->timeOfLastPacketReceived)))) = now; + // Global last receive time regardless of path + _lastReceive = now; + // Learn paths from direct packets (hops == 0) if (!hops) { { |
