diff --git a/app/backend/nvcomputer.cpp b/app/backend/nvcomputer.cpp index 1144d38f..6b35f09e 100644 --- a/app/backend/nvcomputer.cpp +++ b/app/backend/nvcomputer.cpp @@ -373,6 +373,7 @@ NvComputer::ReachabilityType NvComputer::getActiveAddressReachability() const s.connectToHost(copyOfActiveAddress.address(), copyOfActiveAddress.port()); if (s.waitForConnected(3000)) { Q_ASSERT(!s.localAddress().isNull()); + Q_ASSERT(!s.peerAddress().isNull()); for (const QNetworkInterface& nic : QNetworkInterface::allInterfaces()) { // Ensure the interface is up @@ -421,9 +422,9 @@ NvComputer::ReachabilityType NvComputer::getActiveAddressReachability() const return ReachabilityType::RI_VPN; } - // Didn't meet any of our VPN heuristics. Let's see if it's on-link. + // Didn't meet any of our VPN heuristics. Let's see if the peer address is on-link. Q_ASSERT(addr.prefixLength() >= 0); - if (addr.prefixLength() >= 0 && s.localAddress().isInSubnet(addr.ip(), addr.prefixLength())) { + if (addr.prefixLength() >= 0 && s.localAddress().isInSubnet(s.peerAddress(), addr.prefixLength())) { return ReachabilityType::RI_LAN; }