]> 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)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 3 Apr 2023 15:21:43 +0000 (15:21 +0000)
commit643abfbba7fe9eb7e2000ee3015c7e680cc590a2
treea6a202cf8b890982cceccec39795000e9780bd04
parent0ef11c0ccbea4db66f9edd6818a3a836f6c625f2
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.
lib/dns/request.c