From 315e9809c790937e16b10d38c7e9134d423f1657 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Mon, 19 Aug 2024 17:15:58 +0200 Subject: [PATCH] Remote daita cfg from mullvad-cli --- mullvad-cli/build.rs | 7 ------- mullvad-cli/src/cmds/relay.rs | 1 - mullvad-cli/src/cmds/tunnel.rs | 13 ++----------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/mullvad-cli/build.rs b/mullvad-cli/build.rs index ee547da265b5..de110d3a76b0 100644 --- a/mullvad-cli/build.rs +++ b/mullvad-cli/build.rs @@ -15,11 +15,4 @@ fn main() { )); res.compile().expect("Unable to generate windows resources"); } - let target_os = std::env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS not set"); - - // Enable DAITA by default on desktop - println!("cargo::rustc-check-cfg=cfg(daita)"); - if let "linux" | "windows" | "macos" = target_os.as_str() { - println!(r#"cargo::rustc-cfg=daita"#); - } } diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index eaaa2834111b..4fe11b2a8f95 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -542,7 +542,6 @@ impl Relay { allowed_ips: all_of_the_internet(), endpoint: SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), port), psk: None, - #[cfg(daita)] constant_packet_size: false, }, exit_peer: None, diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs index 911c2f010bbd..c17877b438da 100644 --- a/mullvad-cli/src/cmds/tunnel.rs +++ b/mullvad-cli/src/cmds/tunnel.rs @@ -39,11 +39,9 @@ pub enum TunnelOptions { #[arg(long)] quantum_resistant: Option, /// Configure whether to enable DAITA - #[cfg(daita)] #[arg(long)] daita: Option, /// Configure whether to enable DAITA "use anywhere" - #[cfg(daita)] #[arg(long)] daita_use_anywhere: Option, /// The key rotation interval. Number of hours, or 'any' @@ -103,7 +101,6 @@ impl Tunnel { tunnel_options.wireguard.quantum_resistant, ); - #[cfg(daita)] print_option!("DAITA", tunnel_options.wireguard.daita.enabled); let key = rpc.get_wireguard_key().await?; @@ -140,9 +137,7 @@ impl Tunnel { TunnelOptions::Wireguard { mtu, quantum_resistant, - #[cfg(daita)] daita, - #[cfg(daita)] daita_use_anywhere, rotation_interval, rotate_key, @@ -150,9 +145,7 @@ impl Tunnel { Self::handle_wireguard( mtu, quantum_resistant, - #[cfg(daita)] daita, - #[cfg(daita)] daita_use_anywhere, rotation_interval, rotate_key, @@ -184,8 +177,8 @@ impl Tunnel { async fn handle_wireguard( mtu: Option>, quantum_resistant: Option, - #[cfg(daita)] daita: Option, - #[cfg(daita)] daita_use_anywhere: Option, + daita: Option, + daita_use_anywhere: Option, rotation_interval: Option>, rotate_key: Option, ) -> Result<()> { @@ -201,13 +194,11 @@ impl Tunnel { println!("Quantum resistant setting has been updated"); } - #[cfg(daita)] if let Some(enable_daita) = daita { rpc.set_enable_daita(*enable_daita).await?; println!("DAITA setting has been updated"); } - #[cfg(daita)] if let Some(daita_use_anywhere) = daita_use_anywhere { rpc.set_daita_use_anywhere(*daita_use_anywhere).await?; println!("DAITA setting has been updated");