mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
Userland: Improve how traceroute reports timing data for packets
Previously we'd include the time required to do DNS resolution in the time we'd report for traceroute packets. This would skew the times reported.
This commit is contained in:
parent
f81e581d50
commit
63ff271125
1 changed files with 2 additions and 1 deletions
|
@ -116,6 +116,7 @@ int main(int argc, char** argv)
|
|||
return -1;
|
||||
continue;
|
||||
}
|
||||
auto response_time = m_timer.elapsed();
|
||||
|
||||
if (response.header.type != ICMP_ECHOREPLY && response.header.type != ICMP_TIME_EXCEEDED)
|
||||
continue;
|
||||
|
@ -129,7 +130,7 @@ int main(int argc, char** argv)
|
|||
char addr_buf[INET_ADDRSTRLEN];
|
||||
peer_name = inet_ntop(AF_INET, &peer_address.sin_addr, addr_buf, sizeof(addr_buf));
|
||||
}
|
||||
outln("{:2}: {:50} {:4}ms", ttl, peer_name, m_timer.elapsed());
|
||||
outln("{:2}: {:50} {:4}ms", ttl, peer_name, response_time);
|
||||
|
||||
if (response.header.type == ICMP_TIME_EXCEEDED)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue