Skip to content

Commit

Permalink
feat: Set max hop count
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse committed Aug 2, 2024
1 parent 62e1379 commit 6fb6c96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src-tauri/src/platform_specific/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ fn run_tracert(target_ip: &str) -> Result<usize, String> {
let output = match Command::new("tracert")
.arg("-4") // Force IPv4
.arg("-d") // Prevent resolving intermediate IP addresses
.arg("-h") // Set max hop count
.arg("5")
.arg(target_ip)
.output()
{
Expand All @@ -96,6 +98,7 @@ fn run_tracert(target_ip: &str) -> Result<usize, String> {
} else {
let stderr =
str::from_utf8(&output.stderr).expect("Invalid UTF-8 sequence in command error output");
println!("{}", stderr);
Err(format!("Failed collecting tracert output: {}", stderr))
}
}

0 comments on commit 6fb6c96

Please sign in to comment.