From ee99c2bc99a5c65c7aa8d4b1c541c1a05eb3c286 Mon Sep 17 00:00:00 2001 From: Andrey Batyiev Date: Wed, 19 May 2021 14:08:24 +0300 Subject: [PATCH] =?UTF-8?q?SYNERGY-970=20Synergy1.=20User=20is=20not=20abl?= =?UTF-8?q?e=20to=20connect=20to=20server=20using=20ipv=E2=80=A6=20(#7005)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * SYNERGY-970 Synergy1. User is not able to connect to server using ipv6 without wrapping IP in square quotes *Fix connection without brackets *Fix config screen bug * SYNERGY-970 Synergy1. User is not able to connect to server using ipv6 without wrapping IP in square quotes *Update changelog Co-authored-by: Andrii Batyiev --- ChangeLog | 1 + src/gui/src/MainWindow.cpp | 14 +++++++++++++- src/lib/server/Config.cpp | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb3e12e71..82f65963b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ Bug fixes: - #6993 Fix issues with prefences UI - #6992 UI issues and use cases - #7000 Additional UI tweaks +- #7005 Fix User is not able to connect to server using ipv6 without wrapping IP in square quotes Enhancements: - #6954 Move language selection to advanced section diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 86fcad5ae..398d1d4a6 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -799,7 +799,19 @@ bool MainWindow::clientArgs(QStringList& args, QString& app) } #endif } - args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port()); + + QString hostName = m_pLineEditHostname->text(); + // if interface is IPv6 - ensure that ip is in square brackets + if (hostName.count(':') > 1) { + if(hostName[0] != '[') { + hostName.insert(0, '['); + } + if(hostName[hostName.size() - 1] != ']') { + hostName.push_back(']'); + } + } + + args << hostName + ":" + QString::number(appConfig().port()); return true; } diff --git a/src/lib/server/Config.cpp b/src/lib/server/Config.cpp index 663ffa3ea..1d9b42f8b 100644 --- a/src/lib/server/Config.cpp +++ b/src/lib/server/Config.cpp @@ -137,9 +137,9 @@ Config::removeScreen(const String& name) m_nameToCanonicalName.erase(iter++); } else { - ++index; + ++iter; } - } + } } void