mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-08 09:18:43 +00:00
Fix broken on-link detection that caused non-VPN WAN connections to use LAN MTU
Fixes #1101
This commit is contained in:
parent
89a628a0dd
commit
d364b24378
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue