mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-04 00:36:36 +00:00
Fix build on Qt 5.10 and earlier
This commit is contained in:
parent
49046f88cf
commit
e8d4313454
@ -259,12 +259,11 @@ bool NvComputer::isReachableOverVpn()
|
|||||||
|
|
||||||
for (const QNetworkAddressEntry& addr : nic.addressEntries()) {
|
for (const QNetworkAddressEntry& addr : nic.addressEntries()) {
|
||||||
if (addr.ip() == s.localAddress()) {
|
if (addr.ip() == s.localAddress()) {
|
||||||
qInfo() << "Found matching interface:" << nic.humanReadableName() << nic.type() << nic.flags();
|
qInfo() << "Found matching interface:" << nic.humanReadableName() << nic.flags();
|
||||||
|
|
||||||
if (nic.flags() & QNetworkInterface::IsPointToPoint) {
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||||
// Treat point-to-point links as likely VPNs
|
qInfo() << "Interface Type:" << nic.type();
|
||||||
return true;
|
qInfo() << "Interface MTU:" << nic.maximumTransmissionUnit();
|
||||||
}
|
|
||||||
|
|
||||||
if (nic.type() == QNetworkInterface::Virtual ||
|
if (nic.type() == QNetworkInterface::Virtual ||
|
||||||
nic.type() == QNetworkInterface::Ppp) {
|
nic.type() == QNetworkInterface::Ppp) {
|
||||||
@ -272,14 +271,17 @@ bool NvComputer::isReachableOverVpn()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
|
||||||
qInfo() << "MTU is" << nic.maximumTransmissionUnit();
|
|
||||||
if (nic.maximumTransmissionUnit() != 0 && nic.maximumTransmissionUnit() < 1500) {
|
if (nic.maximumTransmissionUnit() != 0 && nic.maximumTransmissionUnit() < 1500) {
|
||||||
// Treat MTUs under 1500 as likely VPNs
|
// Treat MTUs under 1500 as likely VPNs
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (nic.flags() & QNetworkInterface::IsPointToPoint) {
|
||||||
|
// Treat point-to-point links as likely VPNs
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Didn't meet any of our VPN heuristics
|
// Didn't meet any of our VPN heuristics
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user