]> git.ipfire.org Git - thirdparty/bind9.git/commit
Synchronize dns_request_createraw() and dns_request_create() UDP timeout
authorAram Sargsyan <aram@isc.org>
Mon, 12 Dec 2022 11:55:09 +0000 (11:55 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 3 Apr 2023 16:18:39 +0000 (16:18 +0000)
commit4dc2ff79d6c0ecbe9f2c42f133348a73ed158432
treec487dba38010c3ca158bc8b5647025c5d87dd2a1
parentb015b87fdcdbd753c65bd420373d976a0c6babe7
Synchronize dns_request_createraw() and dns_request_create() UDP timeout

The dns_request_createraw() function, unlike dns_request_create(), when
calculating the UDP timeout value, doesn't check that 'udpretries' is
not zero, and that is the more logical behavior, because the calculation
formula uses division to 'udpretries + 1', where '1' is the first try.

Change the dns_request_create() function to remove the 'udpretries != 0'
condition.

Add a 'REQUIRE(udpretries != UINT_MAX)' check to protect from a division
by zero.

Make the 'request->udpcount' field to represent the number of tries,
instead of the number of retries.

(cherry picked from commit 643abfbba7fe9eb7e2000ee3015c7e680cc590a2)
lib/dns/request.c