fix: prevent client network fallback on strict IP bind failure
fixes: #9552
This commit is contained in:
parent
9c45402552
commit
5035dc843d
1 changed files with 8 additions and 11 deletions
|
|
@ -641,17 +641,14 @@ void Client::handleResume()
|
|||
|
||||
void Client::bindNetworkInterface(IDataSocket *socket) const
|
||||
{
|
||||
try {
|
||||
if (const auto address = Settings::value(Settings::Core::Interface).toString(); !address.isEmpty()) {
|
||||
LOG_VERBOSE("bind to network interface: %s", qPrintable(address));
|
||||
const auto address = Settings::value(Settings::Core::Interface).toString();
|
||||
if (address.isEmpty())
|
||||
return;
|
||||
|
||||
LOG_DEBUG("bind to network interface: %s", qPrintable(address));
|
||||
|
||||
NetworkAddress bindAddress(address.toStdString());
|
||||
bindAddress.resolve();
|
||||
|
||||
socket->bind(bindAddress);
|
||||
}
|
||||
} catch (BaseException &e) {
|
||||
LOG_WARN("%s", e.what());
|
||||
LOG_WARN("operating system will select network interface automatically");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue