diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-11-22 14:53:31 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-11-23 15:30:10 +0100 |
| commit | a12ff0da9c683f8762b033bf5347a885ea2e90ec (patch) | |
| tree | 409d2b4605ac2ac006d4048b5c73caac697397cb /mullvad-cli/src/cmds | |
| parent | 97b269c7052bfcd9dafc15f0ea52fbc892d2770b (diff) | |
| download | mullvadvpn-a12ff0da9c683f8762b033bf5347a885ea2e90ec.tar.xz mullvadvpn-a12ff0da9c683f8762b033bf5347a885ea2e90ec.zip | |
Reset the port if the transport protocol is set to any in the CLI
Diffstat (limited to 'mullvad-cli/src/cmds')
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index fa06e12bd5..7c438e89f3 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -792,7 +792,7 @@ fn parse_transport_port( } } }; - let port = match matches.value_of("port") { + let mut port = match matches.value_of("port") { Some(port) => parse_port_constraint(port)?, None => { if let Some(ref transport_port) = current_constraint { @@ -806,6 +806,11 @@ fn parse_transport_port( } } }; + if port.is_only() && protocol.is_any() && !matches.is_present("port") { + // Reset the port if the transport protocol is set to any. + println!("The port constraint was set to 'any'"); + port = Constraint::Any; + } match (port, protocol) { (Constraint::Any, Constraint::Any) => Ok(None), (Constraint::Any, Constraint::Only(protocol)) => Ok(Some(types::TransportPort { |
