diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-04-17 13:06:02 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-06-25 17:31:36 +0200 |
| commit | 7475c53d540768a49ccda0517a1437bf50a06e2d (patch) | |
| tree | 88013da1ededbc2c7dd20eced025d011c43fd616 /mullvad-cli/src | |
| parent | 540f68fe14164f604be897b0324717aac402b116 (diff) | |
| download | mullvadvpn-7475c53d540768a49ccda0517a1437bf50a06e2d.tar.xz mullvadvpn-7475c53d540768a49ccda0517a1437bf50a06e2d.zip | |
Enable DAITA for linux in CLI and types
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 2 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/tunnel.rs | 14 | ||||
| -rw-r--r-- | mullvad-cli/src/format.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index f022402a83..585b2736a4 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -542,7 +542,7 @@ impl Relay { allowed_ips: all_of_the_internet(), endpoint: SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), port), psk: None, - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] constant_packet_size: false, }, exit_peer: None, diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs index 77338ee336..316bada856 100644 --- a/mullvad-cli/src/cmds/tunnel.rs +++ b/mullvad-cli/src/cmds/tunnel.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clap::Subcommand; use mullvad_management_interface::MullvadProxyClient; -#[cfg(target_os = "windows")] +#[cfg(any(target_os = "windows", target_os = "linux"))] use mullvad_types::wireguard::DaitaSettings; use mullvad_types::{ constraints::Constraint, @@ -41,7 +41,7 @@ pub enum TunnelOptions { #[arg(long)] quantum_resistant: Option<QuantumResistantState>, /// Configure whether to enable DAITA - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] #[arg(long)] daita: Option<BooleanOption>, /// The key rotation interval. Number of hours, or 'any' @@ -101,7 +101,7 @@ impl Tunnel { tunnel_options.wireguard.quantum_resistant, ); - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] print_option!("DAITA", tunnel_options.wireguard.daita.enabled); let key = rpc.get_wireguard_key().await?; @@ -138,7 +138,7 @@ impl Tunnel { TunnelOptions::Wireguard { mtu, quantum_resistant, - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] daita, rotation_interval, rotate_key, @@ -146,7 +146,7 @@ impl Tunnel { Self::handle_wireguard( mtu, quantum_resistant, - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] daita, rotation_interval, rotate_key, @@ -178,7 +178,7 @@ impl Tunnel { async fn handle_wireguard( mtu: Option<Constraint<u16>>, quantum_resistant: Option<QuantumResistantState>, - #[cfg(target_os = "windows")] daita: Option<BooleanOption>, + #[cfg(any(target_os = "windows", target_os = "linux"))] daita: Option<BooleanOption>, rotation_interval: Option<Constraint<RotationInterval>>, rotate_key: Option<RotateKey>, ) -> Result<()> { @@ -194,7 +194,7 @@ impl Tunnel { println!("Quantum resistant setting has been updated"); } - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] if let Some(daita) = daita { rpc.set_daita_settings(DaitaSettings { enabled: *daita }) .await?; diff --git a/mullvad-cli/src/format.rs b/mullvad-cli/src/format.rs index 6b092e8939..abd85b178a 100644 --- a/mullvad-cli/src/format.rs +++ b/mullvad-cli/src/format.rs @@ -174,7 +174,7 @@ fn format_relay_connection( "\nQuantum resistant tunnel: no" }; - #[cfg(target_os = "windows")] + #[cfg(any(target_os = "windows", target_os = "linux"))] let daita = if !verbose { "" } else if endpoint.daita { @@ -182,7 +182,7 @@ fn format_relay_connection( } else { "\nDAITA: no" }; - #[cfg(not(target_os = "windows"))] + #[cfg(not(any(target_os = "windows", target_os = "linux")))] let daita = ""; let mut bridge_type = String::new(); |
