diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-10 10:13:50 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-10 10:13:50 -0700 |
| commit | 5e331d673388f4fdc2eded418f63208dcaec63af (patch) | |
| tree | eb66a72702c4104b84b78a7e95639310c86d2092 /node/Peer.cpp | |
| parent | 068d311ecc7b52f1adaa894864afa54ef49a3e6e (diff) | |
| download | infinitytier-5e331d673388f4fdc2eded418f63208dcaec63af.tar.gz infinitytier-5e331d673388f4fdc2eded418f63208dcaec63af.zip | |
Restrict unite() to desperation==0 since NAT-t only works right now with direct links.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 8639da8f..1926f2e5 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -280,11 +280,11 @@ void Peer::resetWithinScope(const RuntimeEnvironment *RR,InetAddress::IpScope sc } } -void Peer::getBestActiveAddresses(uint64_t now,InetAddress &v4,InetAddress &v6) const +void Peer::getBestActiveAddresses(uint64_t now,InetAddress &v4,InetAddress &v6,unsigned int maxDesperation) const { uint64_t bestV4 = 0,bestV6 = 0; for(unsigned int p=0,np=_numPaths;p<np;++p) { - if (_paths[p].active(now)) { + if ((_paths[p].active(now))&&(_paths[p].lastReceiveDesperation() <= maxDesperation)) { uint64_t lr = _paths[p].lastReceived(); if (lr) { if (_paths[p].address().isV4()) { |
