diff options
| -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 { |
