From 998ca2f5b5ee674942e0085be6cb9ab0ae3befdb Mon Sep 17 00:00:00 2001 From: Markus Pettersson Date: Fri, 23 Aug 2024 16:00:23 +0200 Subject: [PATCH] fixup! Remove split tunnel interface if split tunneling is disabled --- talpid-core/src/split_tunnel/macos/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/talpid-core/src/split_tunnel/macos/mod.rs b/talpid-core/src/split_tunnel/macos/mod.rs index 7433fc3b8ca2..a40da7cc499c 100644 --- a/talpid-core/src/split_tunnel/macos/mod.rs +++ b/talpid-core/src/split_tunnel/macos/mod.rs @@ -428,12 +428,14 @@ impl State { // interface from the user's system. State::Active { route_manager, - process, + mut process, tun_handle, vpn_interface, } if paths.is_empty() => { - drop(tun_handle); - drop(process); + if let Err(error) = tun_handle.shutdown().await { + log::error!("Failed to stop split tunnel: {error}"); + } + process.shutdown().await; Ok(State::StandBy { route_manager, vpn_interface,