Ignore TCP dispatches in DNS_DISPATCHSTATE_NONE state

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().
This commit is contained in:
Ondřej Surý
2022-12-19 14:26:31 +01:00
committed by Ondřej Surý
parent 5cc12ab92c
commit 3edccaf0c7

View 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) {