mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 21:38:51 +03:00
Merge pull request #14504 from treysis/ipv6-outgoing-interfaces
Fix bad IPv6 address format for outgoingInterfaces
This commit is contained in:
commit
4bf4d45389
1 changed files with 7 additions and 5 deletions
|
@ -1457,12 +1457,14 @@ void Session::configureNetworkInterfaces(lt::settings_pack &settingsPack)
|
|||
const QHostAddress addr {ip};
|
||||
if (!addr.isNull())
|
||||
{
|
||||
const QString ip = ((addr.protocol() == QAbstractSocket::IPv6Protocol)
|
||||
? ('[' + Utils::Net::canonicalIPv6Addr(addr).toString() + ']')
|
||||
: addr.toString());
|
||||
endpoints << (ip + portString);
|
||||
const bool isIPv6 = (addr.protocol() == QAbstractSocket::IPv6Protocol);
|
||||
const QString ip = isIPv6
|
||||
? Utils::Net::canonicalIPv6Addr(addr).toString()
|
||||
: addr.toString();
|
||||
|
||||
if ((ip != "0.0.0.0") && (ip != "[::]"))
|
||||
endpoints << ((isIPv6 ? ('[' + ip + ']') : ip) + portString);
|
||||
|
||||
if ((ip != QLatin1String("0.0.0.0")) && (ip != QLatin1String("::")))
|
||||
outgoingInterfaces << ip;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue