mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
make TCP fallback relay address configurable
This commit is contained in:
parent
f8e24f4629
commit
3cbea6c898
1 changed files with 6 additions and 1 deletions
|
@ -747,6 +747,7 @@ public:
|
||||||
// Time we last received a packet from a global address
|
// Time we last received a packet from a global address
|
||||||
uint64_t _lastDirectReceiveFromGlobal;
|
uint64_t _lastDirectReceiveFromGlobal;
|
||||||
#ifdef ZT_TCP_FALLBACK_RELAY
|
#ifdef ZT_TCP_FALLBACK_RELAY
|
||||||
|
InetAddress _fallbackRelayAddress;
|
||||||
uint64_t _lastSendToGlobalV4;
|
uint64_t _lastSendToGlobalV4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -810,6 +811,7 @@ public:
|
||||||
,_udpPortPickerCounter(0)
|
,_udpPortPickerCounter(0)
|
||||||
,_lastDirectReceiveFromGlobal(0)
|
,_lastDirectReceiveFromGlobal(0)
|
||||||
#ifdef ZT_TCP_FALLBACK_RELAY
|
#ifdef ZT_TCP_FALLBACK_RELAY
|
||||||
|
, _fallbackRelayAddress(ZT_TCP_FALLBACK_RELAY)
|
||||||
,_lastSendToGlobalV4(0)
|
,_lastSendToGlobalV4(0)
|
||||||
#endif
|
#endif
|
||||||
,_lastRestart(0)
|
,_lastRestart(0)
|
||||||
|
@ -2138,6 +2140,9 @@ div.icon {\
|
||||||
|
|
||||||
// bondingPolicy cannot be used with allowTcpFallbackRelay
|
// bondingPolicy cannot be used with allowTcpFallbackRelay
|
||||||
_allowTcpFallbackRelay = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true) && !(_node->bondController()->inUse());
|
_allowTcpFallbackRelay = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true) && !(_node->bondController()->inUse());
|
||||||
|
#ifdef ZT_TCP_FALLBACK_RELAY
|
||||||
|
_fallbackRelayAddress = InetAddress(OSUtils::jsonString("tcpFallbackRelay", ZT_TCP_FALLBACK_RELAY).c_str());
|
||||||
|
#endif
|
||||||
_primaryPort = (unsigned int)OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff;
|
_primaryPort = (unsigned int)OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff;
|
||||||
_allowSecondaryPort = OSUtils::jsonBool(settings["allowSecondaryPort"],true);
|
_allowSecondaryPort = OSUtils::jsonBool(settings["allowSecondaryPort"],true);
|
||||||
_secondaryPort = (unsigned int)OSUtils::jsonInt(settings["secondaryPort"],0);
|
_secondaryPort = (unsigned int)OSUtils::jsonInt(settings["secondaryPort"],0);
|
||||||
|
@ -3149,7 +3154,7 @@ div.icon {\
|
||||||
phyOnTcpWritable(_tcpFallbackTunnel->sock,&tmpptr);
|
phyOnTcpWritable(_tcpFallbackTunnel->sock,&tmpptr);
|
||||||
}
|
}
|
||||||
} else if (((now - _lastSendToGlobalV4) < ZT_TCP_FALLBACK_AFTER)&&((now - _lastSendToGlobalV4) > (ZT_PING_CHECK_INVERVAL / 2))) {
|
} else if (((now - _lastSendToGlobalV4) < ZT_TCP_FALLBACK_AFTER)&&((now - _lastSendToGlobalV4) > (ZT_PING_CHECK_INVERVAL / 2))) {
|
||||||
const InetAddress addr(ZT_TCP_FALLBACK_RELAY);
|
const InetAddress addr(_fallbackRelayAddress);
|
||||||
TcpConnection *tc = new TcpConnection();
|
TcpConnection *tc = new TcpConnection();
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_tcpConnections_m);
|
Mutex::Lock _l(_tcpConnections_m);
|
||||||
|
|
Loading…
Add table
Reference in a new issue