From: Ondřej Surý Date: Mon, 19 Dec 2022 16:28:39 +0000 (+0100) Subject: Don't remove dispatches in CANCELED state from the list X-Git-Tag: v9.18.11~28^2~4 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=b714033731027e78e3140e398b0fd3fec536f270;p=thirdparty%2Fbind9.git Don't remove dispatches in CANCELED state from the list In dns_dispatch_gettcp(), we can't remove canceled dispatches from the mgr->list because ISC_LIST_NEXT() would fail in the next iteration. --- diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 97e7fc91916..cf426f32eb7 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -1239,7 +1239,7 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr, { switch (disp->state) { case DNS_DISPATCHSTATE_NONE: - /* Dispatch in indeterminate state */ + /* Dispatch in indeterminate state, skip it */ break; case DNS_DISPATCHSTATE_CONNECTED: /* We found a connected dispatch */ @@ -1254,10 +1254,8 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr, break; case DNS_DISPATCHSTATE_CANCELED: /* - * We found a canceled dispatch, help its - * removal from the list, and skip it. + * We found a canceled dispatch, skip it. */ - ISC_LIST_UNLINK(disp->mgr->list, disp, link); break; default: UNREACHABLE();