]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Ignore TCP dispatches in DNS_DISPATCHSTATE_NONE state
authorOndřej Surý <ondrej@isc.org>
Mon, 19 Dec 2022 13:26:31 +0000 (14:26 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 21 Dec 2022 12:41:15 +0000 (12:41 +0000)
The TCP dispatches in DNS_DISPATCHSTATE_NONE could be either very
fresh or those could be dispatches that failed connecting to the
destination.  Ignore them when trying to connect to an existing
TCP dispatch via dns_dispatch_gettcp().

lib/dns/dispatch.c

index faa52fdc2b9ea5eab6a5890230bb3f1b34f30904..97e7fc9191630351620908ddff8f37eb0aa4f5d2 100644 (file)
@@ -1238,11 +1238,13 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
                     isc_sockaddr_eqaddr(localaddr, &sockname)))
                {
                        switch (disp->state) {
+                       case DNS_DISPATCHSTATE_NONE:
+                               /* Dispatch in indeterminate state */
+                               break;
                        case DNS_DISPATCHSTATE_CONNECTED:
                                /* We found a connected dispatch */
                                dns_dispatch_attach(disp, &disp_connected);
                                break;
-                       case DNS_DISPATCHSTATE_NONE:
                        case DNS_DISPATCHSTATE_CONNECTING:
                                /* We found "a" dispatch, store it for later */
                                if (disp_fallback == NULL) {