Skip to content

Commit

Permalink
Support FORCE_USERSPACE_WIREGUARD on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Serock3 committed Jan 23, 2025
1 parent 4616de6 commit 3763271
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions talpid-wireguard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -716,7 +716,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 = Self::open_wireguard_go_tunnel(
Expand Down

0 comments on commit 3763271

Please sign in to comment.