mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Don't use IPv4 addresses when the user has enabled IPv6 address in the settings.
Conflicts: src/qtlibtorrent/qbtsession.cpp src/smtp.cpp
This commit is contained in:
@@ -2016,7 +2016,8 @@ void QBtSession::setListeningPort(int port) {
|
||||
QString ip;
|
||||
qDebug("This network interface has %d IP addresses", network_iface.addressEntries().size());
|
||||
foreach (const QNetworkAddressEntry &entry, network_iface.addressEntries()) {
|
||||
if (!listen_ipv6 && (entry.ip().protocol() == QAbstractSocket::IPv6Protocol))
|
||||
if ((!listen_ipv6 && (entry.ip().protocol() == QAbstractSocket::IPv6Protocol))
|
||||
|| (listen_ipv6 && (entry.ip().protocol() == QAbstractSocket::IPv4Protocol)))
|
||||
continue;
|
||||
qDebug("Trying to listen on IP %s (%s)", qPrintable(entry.ip().toString()), qPrintable(iface_name));
|
||||
#if LIBTORRENT_VERSION_NUM >= 1600
|
||||
@@ -2027,9 +2028,10 @@ void QBtSession::setListeningPort(int port) {
|
||||
#endif
|
||||
ip = entry.ip().toString();
|
||||
addConsoleMessage(tr("qBittorrent is trying to listen on interface %1 port: TCP/%2", "e.g: qBittorrent is trying to listen on interface 192.168.0.1 port: TCP/6881").arg(ip).arg(QString::number(port)), "blue");
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
addConsoleMessage(tr("qBittorrent didn't find an %1 local address to listen on", "qBittorrent didn't find an IPv4 local address to listen on").arg(listen_ipv6 ? "IPv6" : "IPv4"), "red");
|
||||
}
|
||||
|
||||
// Set download rate limit
|
||||
|
||||
Reference in New Issue
Block a user