From: Aram Sargsyan Date: Tue, 11 Mar 2025 12:24:43 +0000 (+0000) Subject: Fix delv default timeout value X-Git-Tag: v9.21.8~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3417d55fdf29bd5285dae9dfe60d77f47022177;p=thirdparty%2Fbind9.git Fix delv default timeout value The isc_nm_getinitialtimeout() function (and also the previously used isc_nm_gettimeouts() function) returns timeout value(s) in milliseconds, while the dns_request_create() function expects timeout values in seconds. Fix the bug by dividing the timeout value by MS_PER_SEC. There is no added test, because it turns out delv doesn't support setting custom timeout values (as opposed to what is suggested in its man page). Tests should be added later when the '+timeout=T' option is implemented. --- diff --git a/bin/delv/delv.c b/bin/delv/delv.c index d7a5f477d01..eeaed8377f9 100644 --- a/bin/delv/delv.c +++ b/bin/delv/delv.c @@ -2096,7 +2096,8 @@ sendquery(void *arg) { dns_view_attach(view, &(dns_view_t *){ NULL }); - const unsigned int timeout = isc_nm_getinitialtimeout(netmgr); + const unsigned int timeout = isc_nm_getinitialtimeout(netmgr) / + MS_PER_SEC; CHECK(dns_request_create(requestmgr, message, NULL, &peer, NULL, NULL, DNS_REQUESTOPT_TCP, NULL, timeout, timeout, 0, 0, isc_loop(), recvresponse, message,