From 5545db56470250d31c1034fca6e9d884bd4094a3 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 14 Dec 2022 16:10:49 +0100 Subject: [PATCH] dnsdist: Fix the health-check timeout computation for DoH backend The remaining milliseconds after handling the full seconds was not properly converted to microseconds. --- pdns/dnsdistdist/dnsdist-tcp-downstream.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsdistdist/dnsdist-tcp-downstream.hh b/pdns/dnsdistdist/dnsdist-tcp-downstream.hh index 939e6a041a..c966f823c7 100644 --- a/pdns/dnsdistdist/dnsdist-tcp-downstream.hh +++ b/pdns/dnsdistdist/dnsdist-tcp-downstream.hh @@ -156,7 +156,7 @@ protected: struct timeval res = now; res.tv_sec += d_ds->d_config.checkTimeout / 1000; /* ms to s */ - res.tv_usec += (d_ds->d_config.checkTimeout % 1000) / 1000; /* remaining ms to µs */ + res.tv_usec += (d_ds->d_config.checkTimeout % 1000) * 1000; /* remaining ms to µs */ return res; } -- 2.47.2