From cb9dd3e9313fe9445077b8a0237d4f73bfb85108 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Mon, 3 Jan 2022 07:33:25 -0800 Subject: [PATCH] fix(client) disable AAAA resolve, since tokio-tun does not yet have IPv6 support. See: https://github.com/yaa110/tokio-tun/pull/8 --- phantun/src/bin/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phantun/src/bin/client.rs b/phantun/src/bin/client.rs index 4b1060d..b723ecc 100644 --- a/phantun/src/bin/client.rs +++ b/phantun/src/bin/client.rs @@ -99,12 +99,12 @@ async fn main() { let remote_addr = tokio::net::lookup_host(matches.value_of("remote").unwrap()) .await .expect("bad remote address or host") - .next() - .expect("unable to resolve remote host name"); + .find(|addr| addr.is_ipv4()) + .expect("unable to resolve remote host name or no valid A record was returned"); let remote_addr = if let SocketAddr::V4(addr) = remote_addr { addr } else { - panic!("only IPv4 remote address is supported"); + unreachable!(); }; info!("Remote address is: {}", remote_addr);