mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
Little fix to NAT-t alg
This commit is contained in:
parent
f9230eb970
commit
eadafd8de7
1 changed files with 4 additions and 4 deletions
|
@ -490,10 +490,10 @@ unsigned long Switch::doTimerTasks(uint64_t now)
|
||||||
// Strategies 1-3: try escalating ports for symmetric NATs that remap sequentially
|
// Strategies 1-3: try escalating ports for symmetric NATs that remap sequentially
|
||||||
InetAddress tmpaddr(qi->inaddr);
|
InetAddress tmpaddr(qi->inaddr);
|
||||||
int p = (int)qi->inaddr.port() + qi->strategyIteration;
|
int p = (int)qi->inaddr.port() + qi->strategyIteration;
|
||||||
if (p < 0xffff) {
|
if (p > 65535)
|
||||||
tmpaddr.setPort((unsigned int)p);
|
p -= 64511;
|
||||||
qi->peer->sendHELLO(qi->localAddr,tmpaddr,now);
|
tmpaddr.setPort((unsigned int)p);
|
||||||
} else qi->strategyIteration = 5;
|
qi->peer->sendHELLO(qi->localAddr,tmpaddr,now);
|
||||||
} else {
|
} else {
|
||||||
// All strategies tried, expire entry
|
// All strategies tried, expire entry
|
||||||
_contactQueue.erase(qi++);
|
_contactQueue.erase(qi++);
|
||||||
|
|
Loading…
Add table
Reference in a new issue