]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't remove dispatches in CANCELED state from the list
authorOndřej Surý <ondrej@isc.org>
Mon, 19 Dec 2022 16:28:39 +0000 (17:28 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 21 Dec 2022 12:41:15 +0000 (12:41 +0000)
In dns_dispatch_gettcp(), we can't remove canceled dispatches from the
mgr->list because ISC_LIST_NEXT() would fail in the next iteration.

lib/dns/dispatch.c

index 97e7fc9191630351620908ddff8f37eb0aa4f5d2..cf426f32eb7b61ab1fb46685da8a8a4482b2a306 100644 (file)
@@ -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();