summaryrefslogtreecommitdiffhomepage
path: root/talpid-core/src
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2025-02-20 11:09:42 +0100
committerDavid Göransson <david.goransson@mullvad.net>2025-02-25 12:02:00 +0100
commitb63bc866946795be36a617adf65c8c6db071b05d (patch)
treec93db6a693a01510653723812d0985c94f6cd910 /talpid-core/src
parenta473a917e1bfad3c7d9baa1a948eacb5096455aa (diff)
downloadmullvadvpn-b63bc866946795be36a617adf65c8c6db071b05d.tar.xz
mullvadvpn-b63bc866946795be36a617adf65c8c6db071b05d.zip
Reduce open_tun calls (Establish)
Each call to Establish opens a window for leaks on android. By only invoking Establish if the VpnConfig if any of the input has changed and reusing it otherwise we avoid many of these leaks. This commit also waits for android to report back that the routes have been created to ping and verify connectivity to avoid pings going outside the tunnel.
Diffstat (limited to 'talpid-core/src')
-rw-r--r--talpid-core/src/tunnel_state_machine/connecting_state.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/talpid-core/src/tunnel_state_machine/connecting_state.rs b/talpid-core/src/tunnel_state_machine/connecting_state.rs
index 4faef9860f..cb06540b0f 100644
--- a/talpid-core/src/tunnel_state_machine/connecting_state.rs
+++ b/talpid-core/src/tunnel_state_machine/connecting_state.rs
@@ -114,6 +114,10 @@ impl ConnectingState {
ErrorStateCause::SetFirewallPolicyError(error),
)
} else {
+ // HACK: On Android, DNS is part of creating the VPN interface, this call
+ // ensures that the vpn_config is prepared with correct DNS servers in case they
+ // previously set to something else, e.g. in the case of blocking. This call
+ // should probably be part of start_tunnel call.
#[cfg(target_os = "android")]
{
shared_values.prepare_tun_config(false);