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