diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-03-06 10:29:05 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-03-06 10:29:05 +0100 |
| commit | 95f421f2178eaefd2ea46cc94c98628d3ff69cfd (patch) | |
| tree | ce07babf20a950081bf827c0bd291d173335e6c9 | |
| parent | 95684e74b2797715c103bc2acce42e02ed21d9c1 (diff) | |
| parent | b58da29dda7323353a11c83efee863d864c5bb11 (diff) | |
| download | mullvadvpn-95f421f2178eaefd2ea46cc94c98628d3ff69cfd.tar.xz mullvadvpn-95f421f2178eaefd2ea46cc94c98628d3ff69cfd.zip | |
Merge branch 'routemanager-fix'
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | talpid-core/src/winnet.rs | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 420cfd14cb..8719297c50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ Line wrap the file at 100 chars. Th button. - Show when the app failed to block all connections after an error. +#### Windows +- Fix bug where failing to initialize the route manager could cause the daemon to get stuck in a + blocked state. This only affected WireGuard. + ### Security #### Windows - Fix issue in daemon where the `block_when_disconnected` setting was sometimes not honored when diff --git a/talpid-core/src/winnet.rs b/talpid-core/src/winnet.rs index 256695eb5c..21b5bb3ae7 100644 --- a/talpid-core/src/winnet.rs +++ b/talpid-core/src/winnet.rs @@ -260,8 +260,16 @@ impl Drop for WinNetRoute { } pub fn activate_routing_manager(routes: &[WinNetRoute]) -> bool { - return unsafe { WinNet_ActivateRouteManager(Some(log_sink), logging_context()) } - && routing_manager_add_routes(routes); + if unsafe { WinNet_ActivateRouteManager(Some(log_sink), logging_context()) } { + if routing_manager_add_routes(routes) { + true + } else { + deactivate_routing_manager(); + false + } + } else { + false + } } pub struct WinNetCallbackHandle { |
