]> git.ipfire.org Git - thirdparty/bind9.git/commit
Cancel all fetch events in dns_resolver_cancelfetch()
authorAram Sargsyan <aram@isc.org>
Mon, 14 Nov 2022 12:18:06 +0000 (12:18 +0000)
committerMichał Kępień <michal@isc.org>
Thu, 12 Jan 2023 11:54:02 +0000 (12:54 +0100)
commita4fc5e51584c311de2c848fa08d22aad7378ebe2
treeb39b5d13918603227c389ecf190b63693b590ac4
parent72db6402f3da2ef0e82fd2d913a45bcbaf0c1f74
Cancel all fetch events in dns_resolver_cancelfetch()

Although 'dns_fetch_t' fetch can have two associated events, one for
each of 'DNS_EVENT_FETCHDONE' and 'DNS_EVENT_TRYSTALE' types, the
dns_resolver_cancelfetch() function is designed in a way that it
expects only one existing event, which it must cancel, and when it
happens so that 'stale-answer-client-timeout' is enabled and there
are two events, only one of them is canceled, and it results in an
assertion in dns_resolver_destroyfetch(), when it finds a dangling
event.

Change the logic of dns_resolver_cancelfetch() function so that it
cancels both the events (if they exist), and in the right order.

(cherry picked from commit ec2098ca35039e4f81fd0aa7c525eb960b8f47bf)
lib/dns/resolver.c
lib/ns/query.c