]> git.gsnw.org Git - fping.git/commitdiff
Fix measurement of time for timed reports (-Q) to start after DNS name resolution.
authorDavid Schweikert <david@schweikert.ch>
Mon, 22 Dec 2025 21:33:53 +0000 (22:33 +0100)
committerDavid Schweikert <david@schweikert.ch>
Mon, 22 Dec 2025 21:41:15 +0000 (22:41 +0100)
CHANGELOG.md
src/fping.c

index e28651028b235aacfb99a9dddedc6db24c6c0c6e..3437ae953a8e500f9e3becee8a45e3b19f0805c2 100644 (file)
@@ -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)
 ======================
index bb97ddb94bd6926430adc17ac0ec6b526d6c069e..5ca1ec938fcfebba08788d2182e2d6554ca53f72 100644 (file)
@@ -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;
     }