Merge branch '2227-tcp-connection-closed-fix-v9_16' into 'v9_16'

Resolve "BIND 9.16.8 assertion failure"

See merge request isc-projects/bind9!4324
This commit is contained in:
Ondřej Surý 2020-10-29 12:51:38 +00:00
commit 02bdaa48fe
3 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,5 @@
5522. [bug] Fix a race/NULL dereference in TCPDNS. [GL #2227]
5520. [bug] Fixed a number of shutdown races, reference counting
errors, and spurious log messages that could occur
in the network manager. [GL #2221]

View file

@ -41,3 +41,6 @@ Bug Fixes
- Handle `UV_EOF` differently such that it is not treated as a `TCP4RecvErr` or
`TCP6RecvErr`. [GL #2208]
- ``named`` could crash with an assertion failure if a TCP connection is closed
while the request is still processing. [GL #2227]

View file

@ -596,9 +596,16 @@ isc__nm_tcpdns_send(isc_nmhandle_t *handle, isc_region_t *region,
r.base = (unsigned char *)uvreq->uvbuf.base;
r.length = uvreq->uvbuf.len;
isc_nmhandle_attach(sock->outerhandle, &sendhandle);
isc_nm_send(sock->outerhandle, &r, tcpdnssend_cb, uvreq);
if (sock->outerhandle != NULL) {
isc_nmhandle_attach(sock->outerhandle, &sendhandle);
isc_nm_send(sock->outerhandle, &r, tcpdnssend_cb,
uvreq);
} else {
cb(handle, ISC_R_CANCELED, cbarg);
isc_mem_put(sock->mgr->mctx, uvreq->uvbuf.base,
uvreq->uvbuf.len);
isc__nm_uvreq_put(&uvreq, sock);
}
} else {
isc__netievent_tcpdnssend_t *ievent = NULL;