2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

237. [bug] If connect() returned ENOBUFS when the resolver was

initiating a TCP query, the socket didn't get destroyed,
                        and the server did not shut down cleanly.  [RT #107]
This commit is contained in:
Andreas Gustafsson
2000-06-05 22:31:54 +00:00
parent 5a75472f64
commit 9c11326b18
2 changed files with 12 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
237. [bug] If connect() returned ENOBUFS when the resolver was
initiating a TCP query, the socket didn't get destroyed,
and the server did not shut down cleanly.
236. [func] Added new listen-on-v6 config file statement. 236. [func] Added new listen-on-v6 config file statement.
235. [func] Consider it a config file error if a listen-on 235. [func] Consider it a config file error if a listen-on

View File

@@ -684,10 +684,8 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
INSIST(0); INSIST(0);
} }
result = isc_socket_bind(query->tcpsocket, &any); result = isc_socket_bind(query->tcpsocket, &any);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS)
isc_socket_detach(&query->tcpsocket); goto cleanup_socket;
goto cleanup_query;
}
/* /*
* A dispatch will be created once the connect succeeds. * A dispatch will be created once the connect succeeds.
@@ -730,7 +728,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
&addrinfo->sockaddr, task, &addrinfo->sockaddr, task,
resquery_connected, query); resquery_connected, query);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto cleanup_query; goto cleanup_socket;
query->attributes |= RESQUERY_ATTR_CONNECTING; query->attributes |= RESQUERY_ATTR_CONNECTING;
QTRACE("connecting via TCP"); QTRACE("connecting via TCP");
} else { } else {
@@ -743,7 +741,11 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup_socket:
isc_socket_detach(&query->tcpsocket);
cleanup_dispatch: cleanup_dispatch:
if (query->dispatch != NULL)
dns_dispatch_detach(&query->dispatch); dns_dispatch_detach(&query->dispatch);
cleanup_query: cleanup_query: