Restrict unite() to desperation==0 since NAT-t only works right now with direct links.

This commit is contained in:
Adam Ierymenko 2015-04-10 10:13:50 -07:00
parent 068d311ecc
commit 5e331d6733
3 changed files with 11 additions and 8 deletions

View file

@ -289,7 +289,8 @@ bool Switch::unite(const Address &p1,const Address &p2,bool force)
const uint64_t now = RR->node->now();
std::pair<InetAddress,InetAddress> cg(Peer::findCommonGround(*p1p,*p2p,now));
// Right now we only unite desperation == 0 links, which will be direct
std::pair<InetAddress,InetAddress> cg(Peer::findCommonGround(*p1p,*p2p,now,0));
if (!(cg.first))
return false;