diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-06 14:05:58 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-06 14:05:58 -0700 |
| commit | 48a374c82c89b69a71d1922c4396265394e9045f (patch) | |
| tree | 6d4ad3c397afebbf3cb47c77fdfb9e2bc271ad12 /node/Peer.cpp | |
| parent | deee39343e27a4ccae6a0ed8d61b8f5e4d200f45 (diff) | |
| download | infinitytier-48a374c82c89b69a71d1922c4396265394e9045f.tar.gz infinitytier-48a374c82c89b69a71d1922c4396265394e9045f.zip | |
(1) fix crazy bug introduced in doRENDEZVOUS(), (2) reclaim Paths after paths[] condense, (3) fix an edge case around symmetric NAT and external IP change detection.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index ab287d05..c56dbca9 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -339,7 +339,9 @@ bool Peer::resetWithinScope(InetAddress::IpScope scope,uint64_t now) ++x; } _numPaths = y; - return (y < np); + while (y < ZT_MAX_PEER_NETWORK_PATHS) + _paths[y++].path.zero(); // let go of unused SmartPtr<>'s + return (_numPaths < np); } void Peer::getBestActiveAddresses(uint64_t now,InetAddress &v4,InetAddress &v6) const @@ -390,6 +392,8 @@ void Peer::clean(uint64_t now) ++x; } _numPaths = y; + while (y < ZT_MAX_PEER_NETWORK_PATHS) + _paths[y++].path.zero(); // let go of unused SmartPtr<>'s } bool Peer::_pushDirectPaths(const SharedPtr<Path> &path,uint64_t now) |
