]> git.ipfire.org Git - thirdparty/bind9.git/commit
dig +nssearch: send more queries even if setting up one of them fails
authorAram Sargsyan <aram@isc.org>
Wed, 22 Jun 2022 14:52:26 +0000 (14:52 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 22 Jul 2022 09:41:47 +0000 (09:41 +0000)
commitab8343a5f6243b13d01c50770fd8484dca0360fd
tree8531a6fcd3d6ad09c95951dffb6a98bed2246bf6
parent8fecc9dc1ec32b2259dc760dfeedce38c68d4cd1
dig +nssearch: send more queries even if setting up one of them fails

In the NSSEARCH followup lookup, when one of the queries fails to be
set up (UDP) or connected (TCP), DiG doesn't start the next query.
This is a mistake, because in NSSEARCH mode the queries are independent
and DiG shouldn't stop the lookup process just because setting up (or
connecting to) one of the name servers returns an error code in the
`udp_ready()` or `tcp_connected()` callbacks.

Write a new `nssearch_next()` function which takes care of starting the
next query in NSSEARCH mode, so it can be used in several places without
code repetition.

Make sure that the `udp_ready()` and `tcp_connected()` functions call
`nssearch_next()` in case they won't be calling `send_udp()` and
`send_tcp()` respectively, because in that case the `send_done()`
callback, which usually does the job, won't be called.

Refactor `send_done()` to use the newly written `nssearch_next()`
function.

(cherry picked from commit 76bee507b7415b176897b2fb1a3497bfb8ab194a)
bin/dig/dighost.c