]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix "dig +nssearch" indefinitely hanging issue
authorAram Sargsyan <aram@isc.org>
Sun, 20 Mar 2022 13:54:39 +0000 (13:54 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Fri, 1 Apr 2022 10:56:27 +0000 (10:56 +0000)
commit7d360bd05ecf74bb106e773a1ae9ab033672ea8a
tree895080672d0a2f146767c90105c0f7e1e12d6424
parent5b76f0f80e68d26fbb393a0dfeae8081dc6c0df1
Fix "dig +nssearch" indefinitely hanging issue

When finishing the NSSEARCH task and there is no more followup
lookups to start, dig does not destroy the last lookup, which
causes it to hang indefinitely.

Rename the unused `first_pass` member of `dig_query_t` to `started`
and make it `true` in the first callback after `start_udp()` or
`start_tcp()` of the query to indicate that the query has been
started.

Create a new `check_if_queries_done()` function to check whether
all of the queries inside a lookup have been started and finished,
or canceled.

Use the mentioned function in the TRACE code block in `recv_done()`
to check whether the current query is the last one in the lookup and
cancel the lookup in that case to free the resources.
bin/dig/dighost.c
bin/dig/dighost.h