diff --git a/talpid-wireguard/src/lib.rs b/talpid-wireguard/src/lib.rs index 330f6f9c074b..d1e09ff57095 100644 --- a/talpid-wireguard/src/lib.rs +++ b/talpid-wireguard/src/lib.rs @@ -175,6 +175,8 @@ impl WireguardMonitor { let mut config = crate::config::Config::from_parameters(params, desired_mtu) .map_err(Error::WireguardConfigError)?; + let endpoint_addrs: Vec = config.peers().map(|peer| peer.endpoint.ip()).collect(); + let (close_obfs_sender, close_obfs_listener) = sync_mpsc::channel(); // Start obfuscation server and patch the WireGuard config to point the endpoint to it. let obfuscator = args @@ -191,8 +193,6 @@ impl WireguardMonitor { config.mtu = clamp_mtu(params, config.mtu); } - let endpoint_addrs: Vec = config.peers().map(|peer| peer.endpoint.ip()).collect(); - #[cfg(target_os = "windows")] let (setup_done_tx, setup_done_rx) = mpsc::channel(0); let tunnel = Self::open_tunnel(