From: Aram Sargsyan Date: Tue, 18 Feb 2025 17:13:39 +0000 (+0000) Subject: Use the configured TCP connect timeout in checkds_send_toaddr() X-Git-Tag: v9.21.8~12^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9e9b98d55e501d8d972c5b69cf42ad49218f720;p=thirdparty%2Fbind9.git Use the configured TCP connect timeout in checkds_send_toaddr() The checkds_send_toaddr() function uses hardcoded timeout values for both UDP and TCP, however, with TCP named has configurable timeout values. Slightly refactor the timeouts calculation part and use the configured 'tcp-initial-timeout' value as the connect timeout. --- diff --git a/lib/dns/zone.c b/lib/dns/zone.c index dffafb30e2a..593f34c22fc 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -21442,13 +21442,17 @@ checkds_send_toaddr(void *arg) { dns_zone_log(checkds->zone, ISC_LOG_DEBUG(3), "checkds: create request for DS query to %s", addrbuf); - const unsigned int timeout = 5; + uint32_t initial_timeout; + isc_nm_gettimeouts(checkds->zone->zmgr->netmgr, &initial_timeout, NULL, + NULL, NULL, NULL); + const unsigned int connect_timeout = initial_timeout / MS_PER_SEC; + options |= DNS_REQUESTOPT_TCP; - result = dns_request_create(checkds->zone->view->requestmgr, message, - &src, &checkds->dst, NULL, NULL, options, - key, timeout * 3 + 1, timeout * 3 + 1, - timeout, 2, checkds->zone->loop, - checkds_done, checkds, &checkds->request); + result = dns_request_create( + checkds->zone->view->requestmgr, message, &src, &checkds->dst, + NULL, NULL, options, key, connect_timeout, TCP_REQUEST_TIMEOUT, + UDP_REQUEST_TIMEOUT, UDP_REQUEST_RETRIES, checkds->zone->loop, + checkds_done, checkds, &checkds->request); if (result != ISC_R_SUCCESS) { dns_zone_log(checkds->zone, ISC_LOG_DEBUG(3), "checkds: dns_request_create() to %s failed: %s",