From 963113b86dc0c1c214038333fd35ea0e014fafc7 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 20 Aug 2019 10:38:18 -0700 Subject: [PATCH] Minor adjustment to how _allowTcpFallbackRelay is disabled when _multipathMode is set --- service/OneService.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/service/OneService.cpp b/service/OneService.cpp index 93e97bdef..0d1dd337b 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1572,18 +1572,15 @@ public: json &settings = lc["settings"]; _primaryPort = (unsigned int)OSUtils::jsonInt(settings["primaryPort"],(uint64_t)_primaryPort) & 0xffff; - _allowTcpFallbackRelay = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true); + _multipathMode = (unsigned int)OSUtils::jsonInt(settings["multipathMode"],0); + // multipathMode cannot be used with allowTcpFallbackRelay + _allowTcpFallbackRelay = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true) && !_multipathMode; _allowSecondaryPort = OSUtils::jsonBool(settings["allowSecondaryPort"],true); _secondaryPort = (unsigned int)OSUtils::jsonInt(settings["secondaryPort"],0); _tertiaryPort = (unsigned int)OSUtils::jsonInt(settings["tertiaryPort"],0); if (_secondaryPort != 0 || _tertiaryPort != 0) { fprintf(stderr,"WARNING: using manually-specified ports. This can cause NAT issues." ZT_EOL_S); } - _multipathMode = (unsigned int)OSUtils::jsonInt(settings["multipathMode"],0); - if (_multipathMode != 0 && _allowTcpFallbackRelay) { - fprintf(stderr,"WARNING: multipathMode cannot be used with allowTcpFallbackRelay. Disabling allowTcpFallbackRelay" ZT_EOL_S); - _allowTcpFallbackRelay = false; - } _portMappingEnabled = OSUtils::jsonBool(settings["portMappingEnabled"],true); #ifndef ZT_SDK