Skip to content

Commit

Permalink
Fix ipv6 usage. Closes #450
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Dec 16, 2024
1 parent 23c360e commit 6b54ce4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gping/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,14 @@ fn main() -> Result<()> {
} else {
let interval =
Duration::from_millis((args.watch_interval.unwrap_or(0.2) * 1000.0) as u64);
let mut ping_opts = PingOptions::new(host_or_cmd, interval, args.interface.clone());

let mut ping_opts = if args.ipv4 {
PingOptions::new_ipv4(host_or_cmd, interval, args.interface.clone())
} else if args.ipv6 {
PingOptions::new_ipv6(host_or_cmd, interval, args.interface.clone())
} else {
PingOptions::new(host_or_cmd, interval, args.interface.clone())
};
if let Some(ping_args) = &args.ping_args {
ping_opts = ping_opts.with_raw_arguments(ping_args.clone());
}
Expand Down

0 comments on commit 6b54ce4

Please sign in to comment.