Skip to content

Commit

Permalink
fix: filter for Ipv4 addresses when resolving hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiapple852 committed May 9, 2022
1 parent a02b1c1 commit 44554fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ fn main() -> anyhow::Result<()> {
.map(|target| {
let target_addr: IpAddr = resolver
.lookup(target)
.map_err(|e| anyhow!("failed to resolve target: {} ({})", target, e))?[0];
.map_err(|e| anyhow!("failed to resolve target: {} ({})", target, e))?
.into_iter()
.find(|addr| matches!(addr, IpAddr::V4(_)))
.unwrap();
let trace_data = Arc::new(RwLock::new(Trace::new(args.tui_max_samples)));
Ok(TuiTraceInfo::new(
trace_data,
Expand Down

0 comments on commit 44554fc

Please sign in to comment.