diff options
| -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)?; |
