summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-01-18 18:10:44 +0100
committerDavid Lönnhager <david.l@mullvad.net>2021-03-01 13:49:45 +0100
commitea12d9b2b55ed19e23566fc3a03fc6095d30bd4f (patch)
tree0620d6583e45eb45c8b9651aedd342ba36f3ce21 /mullvad-cli
parentb78b67b16de4a1cfe55b1bcecc6832e3beb7c368 (diff)
downloadmullvadvpn-ea12d9b2b55ed19e23566fc3a03fc6095d30bd4f.tar.xz
mullvadvpn-ea12d9b2b55ed19e23566fc3a03fc6095d30bd4f.zip
List IPv6 addresses with 'mullvad relay list'
Diffstat (limited to 'mullvad-cli')
-rw-r--r--mullvad-cli/Cargo.toml1
-rw-r--r--mullvad-cli/src/cmds/relay.rs10
2 files changed, 10 insertions, 1 deletions
diff --git a/mullvad-cli/Cargo.toml b/mullvad-cli/Cargo.toml
index 2090fd5796..603197fa32 100644
--- a/mullvad-cli/Cargo.toml
+++ b/mullvad-cli/Cargo.toml
@@ -20,6 +20,7 @@ env_logger = "0.8.2"
futures = "0.3"
natord = "1.0.9"
serde = "1.0"
+itertools = "0.10"
mullvad-types = { path = "../mullvad-types" }
mullvad-paths = { path = "../mullvad-paths" }
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs
index 0a7d152995..eb1492258a 100644
--- a/mullvad-cli/src/cmds/relay.rs
+++ b/mullvad-cli/src/cmds/relay.rs
@@ -1,5 +1,6 @@
use crate::{location, new_rpc_client, Command, Error, Result};
use clap::{value_t, values_t};
+use itertools::Itertools;
use std::{
io::{self, BufRead},
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
@@ -643,9 +644,16 @@ impl Relay {
(false, true) => "WireGuard",
_ => unreachable!("Bug in relay filtering earlier on"),
};
+ let mut addresses = vec![&relay.ipv4_addr_in];
+ if !relay.ipv6_addr_in.is_empty() {
+ addresses.push(&relay.ipv6_addr_in);
+ }
println!(
"\t\t{} ({}) - {}, hosted by {}",
- relay.hostname, relay.ipv4_addr_in, support_msg, relay.provider
+ relay.hostname,
+ addresses.iter().join(", "),
+ support_msg,
+ relay.provider
);
}
}