From 35c4e28f314881f3f6647deaaaf3e58d2ccb5417 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 9 Nov 2015 14:25:28 -0800 Subject: Mark geo-redirected paths as suboptimal and do not report that we have a peer if all we have is one of these. Also a few other small fixes. --- node/Peer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'node/Peer.cpp') diff --git a/node/Peer.cpp b/node/Peer.cpp index 6f987da2..0e90b17d 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -83,6 +83,7 @@ void Peer::received( Packet::Verb inReVerb) { #ifdef ZT_ENABLE_CLUSTER + bool suboptimalPath = false; if ((RR->cluster)&&(hops == 0)) { // Note: findBetterEndpoint() is first since we still want to check // for a better endpoint even if we don't actually send a redirect. @@ -124,6 +125,7 @@ void Peer::received( RR->antiRec->logOutgoingZT(outp.data(),outp.size()); RR->node->putPacket(localAddr,remoteAddr,outp.data(),outp.size()); } + suboptimalPath = true; } } #endif @@ -151,6 +153,9 @@ void Peer::received( for(unsigned int p=0;preceived(now); +#ifdef ZT_ENABLE_CLUSTER + slot->setClusterSuboptimal(suboptimalPath); +#endif _numPaths = np; pathIsConfirmed = true; _sortPaths(now); -- cgit v1.2.3