mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-15 14:56:33 +00:00
Little fix to NAT-t alg
This commit is contained in:
parent
f9230eb970
commit
eadafd8de7
@ -490,10 +490,10 @@ unsigned long Switch::doTimerTasks(uint64_t now)
|
||||
// Strategies 1-3: try escalating ports for symmetric NATs that remap sequentially
|
||||
InetAddress tmpaddr(qi->inaddr);
|
||||
int p = (int)qi->inaddr.port() + qi->strategyIteration;
|
||||
if (p < 0xffff) {
|
||||
tmpaddr.setPort((unsigned int)p);
|
||||
qi->peer->sendHELLO(qi->localAddr,tmpaddr,now);
|
||||
} else qi->strategyIteration = 5;
|
||||
if (p > 65535)
|
||||
p -= 64511;
|
||||
tmpaddr.setPort((unsigned int)p);
|
||||
qi->peer->sendHELLO(qi->localAddr,tmpaddr,now);
|
||||
} else {
|
||||
// All strategies tried, expire entry
|
||||
_contactQueue.erase(qi++);
|
||||
|
Loading…
x
Reference in New Issue
Block a user