From b117ff54358d4e2b6b8eae4bd5300464f377d948 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 10 Apr 2014 11:17:54 -0700 Subject: Probable fix for GitHub issue #63 - do not unite() if either path is TCP, since doing so can result in asymmetric failed NAT-t over UDP if one side has a firewall that permits outgoing UDP but not incoming. --- node/Peer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'node/Peer.cpp') diff --git a/node/Peer.cpp b/node/Peer.cpp index 86a0da0f..5c87275f 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -117,7 +117,7 @@ void Peer::receive( _lastMulticastFrame = now; } -bool Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,uint64_t now) +Path::Type Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,uint64_t now) { Mutex::Lock _l(_lock); @@ -164,9 +164,9 @@ bool Peer::send(const RuntimeEnvironment *_r,const void *data,unsigned int len,u if ((bestPath)&&(_r->sm->send(bestPath->address(),bestPath->tcp(),bestPath->type() == Path::PATH_TYPE_TCP_OUT,data,len))) { bestPath->sent(now); - return true; + return bestPath->type(); } - return false; + return Path::PATH_TYPE_NULL; } bool Peer::sendFirewallOpener(const RuntimeEnvironment *_r,uint64_t now) -- cgit v1.2.3