From 390a5506595029c792d29bd36adbc31e56cfae62 Mon Sep 17 00:00:00 2001 From: Markus Pettersson Date: Tue, 17 Sep 2024 15:47:37 +0200 Subject: [PATCH] fixup! Fix negotiation of ephemeral peer failing due to timeout --- talpid-wireguard/src/lib.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/talpid-wireguard/src/lib.rs b/talpid-wireguard/src/lib.rs index cf68f4d66fd4..c009d311cc8a 100644 --- a/talpid-wireguard/src/lib.rs +++ b/talpid-wireguard/src/lib.rs @@ -264,7 +264,6 @@ async fn maybe_create_obfuscator( impl WireguardMonitor { /// Starts a WireGuard tunnel with the given config - /// TODO: Remove any android-specific parts. #[cfg(not(target_os = "android"))] pub fn start< F: (Fn(TunnelEvent) -> Pin + Send>>) @@ -296,8 +295,6 @@ impl WireguardMonitor { log_path, args.resource_dir, args.tun_provider.clone(), - #[cfg(target_os = "android")] - config.quantum_resistant, #[cfg(target_os = "windows")] args.route_manager.clone(), #[cfg(target_os = "windows")] @@ -305,15 +302,6 @@ impl WireguardMonitor { )?; let iface_name = tunnel.get_interface_name(); - #[cfg(target_os = "android")] - if let Some(remote_socket_fd) = obfuscator.as_ref().map(|obfs| obfs.remote_socket_fd()) { - // Exclude remote obfuscation socket or bridge - log::debug!("Excluding remote socket fd from the tunnel"); - if let Err(error) = args.tun_provider.lock().unwrap().bypass(remote_socket_fd) { - log::error!("Failed to exclude remote socket fd: {error}"); - } - } - let obfuscator = Arc::new(AsyncMutex::new(obfuscator)); let event_callback = Box::new(on_event.clone()); @@ -378,8 +366,6 @@ impl WireguardMonitor { args.retry_attempt, obfuscator.clone(), ephemeral_obfs_sender, - #[cfg(target_os = "android")] - args.tun_provider, ) .await?; @@ -391,7 +377,6 @@ impl WireguardMonitor { .await; } - #[cfg(not(target_os = "android"))] if detect_mtu { let config = config.clone(); let iface_name = iface_name.clone(); @@ -422,6 +407,7 @@ impl WireguardMonitor { }; }); } + let mut connectivity_monitor = tokio::task::spawn_blocking(move || { match connectivity_monitor.establish_connectivity(args.retry_attempt) { Ok(true) => Ok(connectivity_monitor),