diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-07-05 13:49:18 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-07-05 13:49:18 +0200 |
| commit | e3c8238243a7202856637014bbf3d6007545ba72 (patch) | |
| tree | 22f502fdfdff2ba7f2da4d252beb30760938c9d7 | |
| parent | 1112f2683ca7bf0fe1a761b638d1eb558a75a118 (diff) | |
| parent | 1f95e60707ad422a205faff49090131977be6fab (diff) | |
| download | mullvadvpn-e3c8238243a7202856637014bbf3d6007545ba72.tar.xz mullvadvpn-e3c8238243a7202856637014bbf3d6007545ba72.zip | |
Merge branch 'windows-st-fix-fw-reset'
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | talpid-core/src/split_tunnel/windows/driver.rs | 3 | ||||
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/mod.rs | 9 |
3 files changed, 10 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e6a3652e0..b8d1ad2b40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,8 @@ Line wrap the file at 100 chars. Th close. - Remove deleted network devices from consideration in the offline monitor. Previously, the offline monitor may have falsely reported the machine to be online due to a race condition. +- Recover firewall state correctly when restarting the service after a crash. This would fail when + paths were excluded. ## [2021.4] - 2021-06-30 diff --git a/talpid-core/src/split_tunnel/windows/driver.rs b/talpid-core/src/split_tunnel/windows/driver.rs index a162e35ffe..feb60dbc88 100644 --- a/talpid-core/src/split_tunnel/windows/driver.rs +++ b/talpid-core/src/split_tunnel/windows/driver.rs @@ -157,6 +157,9 @@ impl DeviceHandle { device.register_processes()?; } + log::trace!("Clearing any existing exclusion config"); + device.clear_config()?; + Ok(device) } diff --git a/talpid-core/src/tunnel_state_machine/mod.rs b/talpid-core/src/tunnel_state_machine/mod.rs index 97324e3484..a426173c9e 100644 --- a/talpid-core/src/tunnel_state_machine/mod.rs +++ b/talpid-core/src/tunnel_state_machine/mod.rs @@ -223,6 +223,10 @@ impl TunnelStateMachine { #[cfg(target_os = "android")] android_context: AndroidContext, #[cfg(windows)] exclude_paths: Vec<OsString>, ) -> Result<Self, Error> { + #[cfg(windows)] + let split_tunnel = split_tunnel::SplitTunnel::new(command_tx.clone()) + .map_err(Error::InitSplitTunneling)?; + let args = FirewallArguments { initialize_blocked: block_when_disconnected || !reset_firewall, allow_lan, @@ -243,7 +247,7 @@ impl TunnelStateMachine { ) .map_err(Error::InitDnsMonitorError)?; let mut offline_monitor = offline::spawn_monitor( - command_tx.clone(), + command_tx, #[cfg(target_os = "linux")] route_manager .handle() @@ -256,9 +260,6 @@ impl TunnelStateMachine { let is_offline = offline_monitor.is_offline().await; #[cfg(windows)] - let split_tunnel = - split_tunnel::SplitTunnel::new(command_tx).map_err(Error::InitSplitTunneling)?; - #[cfg(windows)] split_tunnel .set_paths(&exclude_paths) .map_err(Error::InitSplitTunneling)?; |
