diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-05-28 09:05:52 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-07-02 09:54:19 +0200 |
| commit | 2754ef21d95144e1f8922ee95608af026c76dcef (patch) | |
| tree | 3c3c1e6b2bca5cff2448a253a50606d8e8f47231 | |
| parent | a0895524074cead9929a55f00b7429b9cf7e8009 (diff) | |
| download | mullvadvpn-2754ef21d95144e1f8922ee95608af026c76dcef.tar.xz mullvadvpn-2754ef21d95144e1f8922ee95608af026c76dcef.zip | |
Prevent block when offline monitor lags behind ST monitor
| -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() |
