summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSebastian Holmin <sebastian.holmin@mullvad.net>2025-01-23 11:27:59 +0100
committerDavid Lönnhager <david.l@mullvad.net>2025-01-24 17:35:04 +0100
commit50b31b950a1a533aeb580af1dbc334dedb0d04fd (patch)
tree1c8211c05df337e67de0260677bc2cd370ced108
parent28b6fa8314f5ef880358bdb6f45a06e249273250 (diff)
downloadmullvadvpn-50b31b950a1a533aeb580af1dbc334dedb0d04fd.tar.xz
mullvadvpn-50b31b950a1a533aeb580af1dbc334dedb0d04fd.zip
Support `FORCE_USERSPACE_WIREGUARD` on windows
-rw-r--r--talpid-wireguard/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/talpid-wireguard/src/lib.rs b/talpid-wireguard/src/lib.rs
index 863b767ae1..ea3207f12d 100644
--- a/talpid-wireguard/src/lib.rs
+++ b/talpid-wireguard/src/lib.rs
@@ -18,7 +18,7 @@ use std::{
pin::Pin,
sync::{mpsc as sync_mpsc, Arc, Mutex},
};
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "windows"))]
use std::{env, sync::LazyLock};
#[cfg(not(target_os = "android"))]
use talpid_routing::{self, RequiredRoute};
@@ -149,7 +149,7 @@ pub struct WireguardMonitor {
obfuscator: Arc<AsyncMutex<Option<ObfuscatorHandle>>>,
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "linux", target_os = "windows"))]
/// Overrides the preference for the kernel module for WireGuard.
static FORCE_USERSPACE_WIREGUARD: LazyLock<bool> = LazyLock::new(|| {
env::var("TALPID_FORCE_USERSPACE_WIREGUARD")
@@ -693,7 +693,7 @@ impl WireguardMonitor {
{
#[cfg(wireguard_go)]
{
- let use_userspace_wg = config.daita;
+ let use_userspace_wg = config.daita || *FORCE_USERSPACE_WIREGUARD;
if use_userspace_wg {
log::debug!("Using userspace WireGuard implementation");
let tunnel = runtime