diff options
Diffstat (limited to 'node/Switch.cpp')
| -rw-r--r-- | node/Switch.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index d01d77ca..0aa0b664 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -741,9 +741,11 @@ bool Switch::_trySend(const Packet &packet,bool encrypt,uint64_t nwid) if (nconf) { unsigned int latency = ~((unsigned int)0); for(std::vector< std::pair<Address,InetAddress> >::const_iterator r(nconf->relays().begin());r!=nconf->relays().end();++r) { - SharedPtr<Peer> rp(RR->topology->getPeer(r->first)); - if ((rp->hasActiveDirectPath(now))&&(rp->latency() <= latency)) - rp.swap(relay); + if (r->first != peer->address()) { + SharedPtr<Peer> rp(RR->topology->getPeer(r->first)); + if ((rp)&&(rp->hasActiveDirectPath(now))&&(rp->latency() <= latency)) + rp.swap(relay); + } } } } |
