]> 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 11:13:20 +0000 (12:13 +0100)
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 50cdee81fad1164c3c9430f7414e43ff9c024181..b5923b1ed57e86cd9f9301f7122d7dde73eb102e 100644 (file)
@@ -1265,7 +1265,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 */
@@ -1280,10 +1280,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();