From b3de7e4bf350f79d93018a6c637d65840cb69494 Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Mon, 22 Dec 2025 22:33:53 +0100 Subject: [PATCH] Fix measurement of time for timed reports (-Q) to start after DNS name resolution. --- CHANGELOG.md | 2 ++ src/fping.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e286510..3437ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ fping 5.5-rc1 (2025-12-21) - Fix debug build use of dbg_printf in fping.c (#415, thanks @auerswal) - Remove MacOS-specific test for -I option (#407) - GitHub Actions fixes (thanks @gsnw-sebast) +- Fix measurement of time for timed reports (-Q) to start after DNS name + resolution. fping 5.4 (2025-04-19) ====================== diff --git a/src/fping.c b/src/fping.c index bb97ddb..5ca1ec9 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1434,6 +1434,10 @@ int main(int argc, char **argv) #endif setlinebuf(stdout); + // Last time we updated current_time_ns was before adding the hosts and + // possibly doing DNS resolution, which means that it isn't accurate + // anymore. + update_current_time(); if (report_interval) { next_report_time = current_time_ns + report_interval; } -- 2.43.0