summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOdd Stranne <odd@mullvad.net>2019-11-26 13:40:40 +0100
committerOdd Stranne <odd@mullvad.net>2019-11-26 13:40:40 +0100
commit7f075d9c74682e5efa36d3aa07f6e792596c6120 (patch)
treea7c44c780a31b3122a687cb2d0bec0bcb29733de
parent4d43f1b7db42802b3e88dd987e5b876fc9574f0b (diff)
parent547116a738b99ed5e67d3b9d46e614187c4245ea (diff)
downloadmullvadvpn-7f075d9c74682e5efa36d3aa07f6e792596c6120.tar.xz
mullvadvpn-7f075d9c74682e5efa36d3aa07f6e792596c6120.zip
Merge branch 'win-adjust-adapter-filter'
-rw-r--r--CHANGELOG.md2
-rw-r--r--windows/winnet/src/winnet/offlinemonitor.cpp22
2 files changed, 21 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 879b58a49b..f8d7728f7a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -56,6 +56,8 @@ Line wrap the file at 100 chars. Th
where the registry value type is incorrectly set to be a regular string rather than an expandable
string.
- Fix suspend and resume issues with OpenVPN by upgrading the TAP driver.
+- Minor adjustment in online/offline detection logic. This change addresses misbehaving drivers
+ that report the adapter flags incorrectly.
### Security
- Force OpenVPN to use TLS 1.2 or newer. And limit the TLS 1.3 ciphers to only the strongest ones.
diff --git a/windows/winnet/src/winnet/offlinemonitor.cpp b/windows/winnet/src/winnet/offlinemonitor.cpp
index 4f93a01def..3e223de0e7 100644
--- a/windows/winnet/src/winnet/offlinemonitor.cpp
+++ b/windows/winnet/src/winnet/offlinemonitor.cpp
@@ -24,23 +24,39 @@ bool IsConnectedAdapter(const MIB_IF_ROW2 &iface)
//
// (Windows 10, and possibly others.)
+ //
// The BT adapter is erronously not marked as representing hardware.
// By filtering on this we currently do not support BT tethering.
//
+ // Specifically, the following settings are problematic:
+ //
+ // InterfaceAndOperStatusFlags.HardwareInterface: 0
+ // InterfaceAndOperStatusFlags.ConnectorPresent: 0
+ //
if (FALSE == iface.InterfaceAndOperStatusFlags.HardwareInterface
- || FALSE != iface.InterfaceAndOperStatusFlags.FilterInterface
+ && FALSE == iface.InterfaceAndOperStatusFlags.ConnectorPresent)
+ {
+ return false;
+ }
+
+ //
+ // Maybe checking iface.InterfaceAndOperStatusFlags.NotMediaConnected here
+ // would be a good thing?
+ //
+
+ if (FALSE != iface.InterfaceAndOperStatusFlags.FilterInterface
|| 0 == iface.PhysicalAddressLength
|| FALSE != iface.InterfaceAndOperStatusFlags.EndPointInterface)
{
return false;
}
- bool connected = (
+ return
+ (
IfOperStatusUp == iface.OperStatus
&& MediaConnectStateConnected == iface.MediaConnectState
);
- return connected;
}
} // anonymous namespace