diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-02-02 11:06:04 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-03-01 13:49:45 +0100 |
| commit | 50d057ae92f59f2fadca4fd96568f4401dbffa41 (patch) | |
| tree | df07af6eb14bc1745be256928561e64a2d488086 /mullvad-cli/src | |
| parent | 0da3dc9997b43594e910314a5b5c805c80af914c (diff) | |
| download | mullvadvpn-50d057ae92f59f2fadca4fd96568f4401dbffa41.tar.xz mullvadvpn-50d057ae92f59f2fadca4fd96568f4401dbffa41.zip | |
Rename "IP protocol" to "IP version"
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index 170e1276a3..6343b9e5d5 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -157,8 +157,8 @@ impl Command for Relay { .possible_values(&["any", "udp", "tcp"]), ) .arg( - clap::Arg::with_name("ip protocol") - .long("ip") + clap::Arg::with_name("ip version") + .long("ipv") .required(false) .default_value("any") .possible_values(&["any", "4", "6"]), @@ -475,7 +475,7 @@ impl Relay { let vpn_protocol = matches.value_of("vpn protocol").unwrap(); let port = parse_port_constraint(matches.value_of("port").unwrap())?; let protocol = parse_protocol_constraint(matches.value_of("transport protocol").unwrap()); - let ip_proto = parse_ip_protocol_constraint(matches.value_of("ip protocol").unwrap()); + let ip_version = parse_ip_version_constraint(matches.value_of("ip version").unwrap()); match vpn_protocol { "wireguard" => { @@ -487,7 +487,7 @@ impl Relay { NormalRelaySettingsUpdate { wireguard_constraints: Some(WireguardConstraints { port: port.unwrap_or(0) as u32, - ip_protocol: ip_proto.option().map(|protocol| { + ip_version: ip_version.option().map(|protocol| { IpVersionConstraint { protocol: protocol as i32, } @@ -500,7 +500,7 @@ impl Relay { .await } "openvpn" => { - if let Constraint::Only(_) = ip_proto { + if let Constraint::Only(_) = ip_version { return Err(Error::InvalidCommand( "OpenVPN does not support the IP version constraint", )); @@ -716,7 +716,7 @@ impl Relay { Self::format_port(constraints.port), Self::format_ip_version( constraints - .ip_protocol + .ip_version .clone() .map(|protocol| IpVersion::from_i32(protocol.protocol).unwrap()) ) @@ -784,7 +784,7 @@ fn parse_protocol_constraint(raw_protocol: &str) -> Constraint<TransportProtocol } } -fn parse_ip_protocol_constraint(raw_protocol: &str) -> Constraint<IpVersion> { +fn parse_ip_version_constraint(raw_protocol: &str) -> Constraint<IpVersion> { match raw_protocol { "any" => Constraint::Any, "4" => Constraint::Only(IpVersion::V4), |
