diff options
| -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 { |
