]> 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:43:32 +0000 (12:43 +0100)
commitec2098ca35039e4f81fd0aa7c525eb960b8f47bf
tree2502739fd0c426bd781b6b516a22a3f1ee6d7b20
parent80ed02f935fbc2adcb8ba8632b0365375232b6cd
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.
lib/dns/resolver.c
lib/ns/query.c