From bf1c9e34d7a7361fec844a4412a0bdd4b8b12d4c Mon Sep 17 00:00:00 2001 From: Raif Atef Date: Sun, 5 Apr 2020 19:39:55 +0200 Subject: [PATCH] Fix outgoing interface is not getting assigned Assignment was missing in main branch of condition statement. Closes https://github.com/qbittorrent/qBittorrent/issues/12421 --- src/base/bittorrent/session.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 3b31b97e0..783c12886 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1529,10 +1529,11 @@ void Session::configureNetworkInterfaces(lt::settings_pack &settingsPack) for (const QString &ip : asConst(getListeningIPs())) { const QHostAddress addr {ip}; if (!addr.isNull()) { - endpoints << ((addr.protocol() == QAbstractSocket::IPv6Protocol) + const QString ip = ((addr.protocol() == QAbstractSocket::IPv6Protocol) ? ('[' + Utils::Net::canonicalIPv6Addr(addr).toString() + ']') - : addr.toString()) - + portString; + : addr.toString()); + endpoints << (ip + portString); + outgoingInterfaces << ip; } else { // ip holds an interface name