From ab1bc4b275378050c96abbbef718d47d11b3afdf Mon Sep 17 00:00:00 2001 From: Markus Pettersson Date: Wed, 18 Sep 2024 16:37:14 +0200 Subject: [PATCH] Fix `mullvad status -v` not printing udp2tcp port and transport protocol --- mullvad-cli/src/format.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/mullvad-cli/src/format.rs b/mullvad-cli/src/format.rs index 00c990f17036..ada97cbd5de3 100644 --- a/mullvad-cli/src/format.rs +++ b/mullvad-cli/src/format.rs @@ -229,16 +229,14 @@ fn format_relay_connection( location: Option<&GeoIpLocation>, verbose: bool, ) -> String { - let exit_endpoint = format_endpoint( - location.and_then(|l| l.hostname.as_deref()), - &endpoint.endpoint, - verbose, - ); - let first_hop = endpoint.entry_endpoint.as_ref().map(|entry| { let endpoint = format_endpoint( location.and_then(|l| l.entry_hostname.as_deref()), - entry, + // Check if we *actually* want to print an obfuscator endpoint .. + match endpoint.obfuscation { + Some(ref obfuscation) => &obfuscation.endpoint, + _ => entry, + }, verbose, ); format!(" via {endpoint}") @@ -254,6 +252,17 @@ fn format_relay_connection( format!(" via {proxy_endpoint}") }); + let exit_endpoint = format_endpoint( + location.and_then(|l| l.hostname.as_deref()), + // Check if we *actually* want to print an obfuscator endpoint .. + // The obfuscator information should be printed for the exit relay if multihop is disabled + match (endpoint.obfuscation, &first_hop) { + (Some(ref obfuscation), None) => &obfuscation.endpoint, + _ => &endpoint.endpoint, + }, + verbose, + ); + format!( "{exit_endpoint}{first_hop}{bridge}", first_hop = first_hop.unwrap_or_default(),