mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +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
Notes:
sideshowbarker
2024-07-18 18:48:11 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/63ff271125f Pull-request: https://github.com/SerenityOS/serenity/pull/6794 Reviewed-by: https://github.com/IdanHo ✅
|
@ -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…
Reference in a new issue