mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-25 10:59:35 -05:00
TLS: Avoid accessing listener socket flags from other threads
This commit ensures that the flags inside a TLS listener socket object (and associated worker) are accessed when accepting a connection only from within the context of the dedicated thread, but not other worker threads.
This commit is contained in:
parent
052200cc2b
commit
4b5559cd8f
1 changed files with 3 additions and 4 deletions
|
|
@ -687,10 +687,9 @@ tlslisten_acceptcb(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
|
|||
REQUIRE(VALID_NMSOCK(tlslistensock));
|
||||
REQUIRE(tlslistensock->type == isc_nm_tlslistener);
|
||||
|
||||
if (isc__nmsocket_closing(handle->sock) ||
|
||||
isc__nmsocket_closing(tlslistensock) ||
|
||||
!atomic_load(&tlslistensock->listening))
|
||||
{
|
||||
if (isc__nm_closing(handle->sock->worker)) {
|
||||
return (ISC_R_SHUTTINGDOWN);
|
||||
} else if (isc__nmsocket_closing(handle->sock)) {
|
||||
return (ISC_R_CANCELED);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue