diff options
| -rw-r--r-- | talpid-core/src/split_tunnel/windows/mod.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/talpid-core/src/split_tunnel/windows/mod.rs b/talpid-core/src/split_tunnel/windows/mod.rs index 95631dd569..c5c57d5ab3 100644 --- a/talpid-core/src/split_tunnel/windows/mod.rs +++ b/talpid-core/src/split_tunnel/windows/mod.rs @@ -353,8 +353,8 @@ impl SplitTunnel { /// Configures IP addresses used for socket rebinding. fn register_ips( handle: &Mutex<driver::DeviceHandle>, - tunnel_ipv4: Ipv4Addr, - tunnel_ipv6: Option<Ipv6Addr>, + mut tunnel_ipv4: Ipv4Addr, + mut tunnel_ipv6: Option<Ipv6Addr>, internet_ipv4: Option<Ipv4Addr>, internet_ipv6: Option<Ipv6Addr>, ) -> Result<(), Error> { @@ -366,13 +366,10 @@ impl SplitTunnel { internet_ipv6 ); - // If there is no valid internet address, ignore any tunnel addresses. - // This should only be the case if a reserved tunnel IP is used to keep the driver engaged. - let tunnel_ipv4 = if internet_ipv4.is_none() && internet_ipv6.is_none() { - Ipv4Addr::new(0, 0, 0, 0) - } else { - tunnel_ipv4 - }; + if internet_ipv4.is_none() && internet_ipv6.is_none() { + tunnel_ipv4 = Ipv4Addr::new(0, 0, 0, 0); + tunnel_ipv6 = None; + } handle .lock() |
