Lock dispatch manager buffer_lock before accessing buffers;
Only test buffers for UDP dispatches.
(cherry picked from commit 011af4de71)
This commit is contained in:
@@ -1513,8 +1513,14 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
||||
if (disp->recv_pending != 0 && dispsock == NULL)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
if (disp->mgr->buffers >= disp->mgr->maxbuffers)
|
||||
return (ISC_R_NOMEMORY);
|
||||
if (disp->socktype == isc_sockettype_udp) {
|
||||
LOCK(&disp->mgr->buffer_lock);
|
||||
if (disp->mgr->buffers >= disp->mgr->maxbuffers) {
|
||||
UNLOCK(&disp->mgr->buffer_lock);
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
UNLOCK(&disp->mgr->buffer_lock);
|
||||
}
|
||||
|
||||
if ((disp->attributes & DNS_DISPATCHATTR_EXCLUSIVE) != 0 &&
|
||||
dispsock == NULL)
|
||||
|
||||
Reference in New Issue
Block a user