Only store the local address from mDNS if it actually worked

This commit is contained in:
Cameron Gutman 2019-07-31 22:15:29 -07:00
parent 940da6bc73
commit 5e106d2f19

View File

@ -665,7 +665,12 @@ private:
// Update addresses depending on the context
if (m_Mdns) {
// Only update local address if we actually reached the PC via this address.
// If we reached it via the IPv6 address after the local address failed,
// don't store the non-working local address.
if (http.address() == m_Address) {
newComputer->localAddress = m_Address;
}
// Get the WAN IP address using STUN if we're on mDNS over IPv4
if (QHostAddress(newComputer->localAddress).protocol() == QAbstractSocket::IPv4Protocol) {