diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-02-27 20:55:27 +0000 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-02-28 14:58:08 +0000 |
| commit | 91a849d9b1dec24cdbd7ac137102e02472dbaf64 (patch) | |
| tree | c81044bad66b96c5c0b884bb8385332ba6d9cc7b /mullvad-cli/src/cmds | |
| parent | 4511b00ecd8b243cacaf4cdc8952616d2b5ce53c (diff) | |
| download | mullvadvpn-91a849d9b1dec24cdbd7ac137102e02472dbaf64.tar.xz mullvadvpn-91a849d9b1dec24cdbd7ac137102e02472dbaf64.zip | |
Remove fwmark based routing for linux
Diffstat (limited to 'mullvad-cli/src/cmds')
| -rw-r--r-- | mullvad-cli/src/cmds/tunnel.rs | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs index 0c05c1946d..4cc4af4867 100644 --- a/mullvad-cli/src/cmds/tunnel.rs +++ b/mullvad-cli/src/cmds/tunnel.rs @@ -35,16 +35,11 @@ impl Command for Tunnel { } fn create_wireguard_subcommand() -> clap::App<'static, 'static> { - let app = clap::SubCommand::with_name("wireguard") + clap::SubCommand::with_name("wireguard") .about("Manage options for Wireguard tunnels") .setting(clap::AppSettings::SubcommandRequired) .subcommand(create_wireguard_mtu_subcommand()) - .subcommand(create_wireguard_keys_subcommand()); - if cfg!(target_os = "linux") { - app.subcommand(create_wireguard_fwmark_subcommand()) - } else { - app - } + .subcommand(create_wireguard_keys_subcommand()) } fn create_wireguard_mtu_subcommand() -> clap::App<'static, 'static> { @@ -66,15 +61,6 @@ fn create_wireguard_keys_subcommand() -> clap::App<'static, 'static> { .subcommand(clap::SubCommand::with_name("generate")) } -fn create_wireguard_fwmark_subcommand() -> clap::App<'static, 'static> { - clap::SubCommand::with_name("fwmark") - .about("Configure the firewall mark used to direct traffic through Wireguard tunnel") - .setting(clap::AppSettings::SubcommandRequired) - .subcommand(clap::SubCommand::with_name("get")) - .subcommand( - clap::SubCommand::with_name("set").arg(clap::Arg::with_name("fwmark").required(true)), - ) -} fn create_openvpn_subcommand() -> clap::App<'static, 'static> { clap::SubCommand::with_name("openvpn") @@ -241,13 +227,6 @@ impl Tunnel { ("generate", _) => Self::process_wireguard_key_generate(), _ => unreachable!("unhandled command"), }, - - #[cfg(target_os = "linux")] - ("fwmark", Some(matches)) => match matches.subcommand() { - ("get", _) => Self::process_wireguard_fwmark_get(), - ("set", Some(fwmark_matches)) => Self::process_wireguard_fwmark_set(fwmark_matches), - _ => unreachable!("unhandled command"), - }, _ => unreachable!("unhandled command"), } } @@ -302,22 +281,6 @@ impl Tunnel { rpc.generate_wireguard_key().map_err(|e| e.into()) } - #[cfg(target_os = "linux")] - fn process_wireguard_fwmark_get() -> Result<()> { - let tunnel_options = Self::get_tunnel_options()?; - println!("fwmark: {}", tunnel_options.wireguard.fwmark); - Ok(()) - } - - #[cfg(target_os = "linux")] - fn process_wireguard_fwmark_set(matches: &clap::ArgMatches) -> Result<()> { - let fwmark = value_t!(matches.value_of("fwmark"), i32).unwrap_or_else(|e| e.exit()); - let mut rpc = new_rpc_client()?; - rpc.set_wireguard_fwmark(fwmark)?; - println!("Firewall mark parameter has been updated"); - Ok(()) - } - fn handle_ipv6_cmd(matches: &clap::ArgMatches) -> Result<()> { if matches.subcommand_matches("get").is_some() { Self::process_ipv6_get() |
