Skip to content

Commit

Permalink
fix(client) disable AAAA resolve, since tokio-tun does not yet have IPv6
Browse files Browse the repository at this point in the history
support. See: yaa110/tokio-tun#8
  • Loading branch information
dndx committed Jan 3, 2022
1 parent 7db7164 commit cb9dd3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions phantun/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit cb9dd3e

Please sign in to comment.