summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli/src/cmds
diff options
context:
space:
mode:
authorSebastian Holmin <sebastian.holmin@mullvad.net>2024-04-17 13:06:02 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-06-25 17:31:36 +0200
commit7475c53d540768a49ccda0517a1437bf50a06e2d (patch)
tree88013da1ededbc2c7dd20eced025d011c43fd616 /mullvad-cli/src/cmds
parent540f68fe14164f604be897b0324717aac402b116 (diff)
downloadmullvadvpn-7475c53d540768a49ccda0517a1437bf50a06e2d.tar.xz
mullvadvpn-7475c53d540768a49ccda0517a1437bf50a06e2d.zip
Enable DAITA for linux in CLI and types
Diffstat (limited to 'mullvad-cli/src/cmds')
-rw-r--r--mullvad-cli/src/cmds/relay.rs2
-rw-r--r--mullvad-cli/src/cmds/tunnel.rs14
2 files changed, 8 insertions, 8 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?;