Merge "QNetworkInterface/Unix: fix DNS eligibility of global addresses"

This commit is contained in:
Thiago Macieira 2021-03-03 16:58:34 -08:00 committed by Qt CI Bot
commit d58d0bb970

View File

@ -104,14 +104,15 @@ public:
{
// this implements an algorithm that yields the same results as Windows
// produces, for the same input (as far as I can test)
if (isTemporary || isDeprecated)
if (isTemporary || isDeprecated) {
entry->setDnsEligibility(QNetworkAddressEntry::DnsIneligible);
AddressClassification cl = QHostAddressPrivate::classify(entry->ip());
if (cl == LoopbackAddress || cl == LinkLocalAddress)
entry->setDnsEligibility(QNetworkAddressEntry::DnsIneligible);
else
entry->setDnsEligibility(QNetworkAddressEntry::DnsEligible);
} else {
AddressClassification cl = QHostAddressPrivate::classify(entry->ip());
if (cl == LoopbackAddress || cl == LinkLocalAddress)
entry->setDnsEligibility(QNetworkAddressEntry::DnsIneligible);
else
entry->setDnsEligibility(QNetworkAddressEntry::DnsEligible);
}
}
private: