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
|
void Client::bindNetworkInterface(IDataSocket *socket) const
|
||||||
{
|
{
|
||||||
try {
|
const auto address = Settings::value(Settings::Core::Interface).toString();
|
||||||
if (const auto address = Settings::value(Settings::Core::Interface).toString(); !address.isEmpty()) {
|
if (address.isEmpty())
|
||||||
LOG_VERBOSE("bind to network interface: %s", qPrintable(address));
|
return;
|
||||||
|
|
||||||
NetworkAddress bindAddress(address.toStdString());
|
LOG_DEBUG("bind to network interface: %s", qPrintable(address));
|
||||||
bindAddress.resolve();
|
|
||||||
|
|
||||||
socket->bind(bindAddress);
|
NetworkAddress bindAddress(address.toStdString());
|
||||||
}
|
bindAddress.resolve();
|
||||||
} catch (BaseException &e) {
|
|
||||||
LOG_WARN("%s", e.what());
|
socket->bind(bindAddress);
|
||||||
LOG_WARN("operating system will select network interface automatically");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue