mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Lock dispatch manager buffer_lock before accessing buffers;
Only test buffers for UDP dispatches.
This commit is contained in:
parent
afc7389ce8
commit
011af4de71
1 changed files with 8 additions and 2 deletions
|
|
@ -1500,8 +1500,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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue