Skip to content

Commit

Permalink
Fix crash when multipath is used with forceTcpRelay
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-henry committed Mar 5, 2024
1 parent 1f4c00c commit d658c11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions service/OneService.cpp
Expand Up @@ -2445,8 +2445,13 @@ class OneServiceImpl : public OneService
}

// bondingPolicy cannot be used with allowTcpFallbackRelay
_allowTcpFallbackRelay = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true);
_forceTcpRelay = OSUtils::jsonBool(settings["forceTcpRelay"],false);
bool _forceTcpRelayTmp = (OSUtils::jsonBool(settings["forceTcpRelay"],false));
bool _bondInUse = _node->bondController()->inUse();
if (_forceTcpRelayTmp && _bondInUse) {
fprintf(stderr, "Warning: forceTcpRelay cannot be used with multipath. Disabling forceTcpRelay\n");
}
_allowTcpFallbackRelay = (OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true) && !_node->bondController()->inUse());
_forceTcpRelay = (_forceTcpRelayTmp && !_node->bondController()->inUse());

#ifdef ZT_TCP_FALLBACK_RELAY
_fallbackRelayAddress = InetAddress(OSUtils::jsonString(settings["tcpFallbackRelay"], ZT_TCP_FALLBACK_RELAY).c_str());
Expand Down

0 comments on commit d658c11

Please sign in to comment.