mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
prevent a possible shutdown hang in rndc
In rndc_recvdone(), if 'sends' was not 0, then 'recvs' was not
decremented, in which case isc_loopmgr_shutdown() was never reached,
which could cause a hang. (This has not been observed to happen, but
the code was incorrect on examination.)
(cherry picked from commit 9683439d73)
This commit is contained in:
parent
de40d702b0
commit
9e0af151e9
1 changed files with 2 additions and 2 deletions
|
|
@ -388,8 +388,8 @@ rndc_recvdone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
|||
REQUIRE(recvdone_handle == handle);
|
||||
isc_nmhandle_detach(&recvdone_handle);
|
||||
|
||||
if (atomic_load_acquire(&sends) == 0 &&
|
||||
atomic_fetch_sub_release(&recvs, 1) == 1)
|
||||
if (atomic_fetch_sub_release(&recvs, 1) == 1 &&
|
||||
atomic_load_acquire(&sends) == 0)
|
||||
{
|
||||
shuttingdown = true;
|
||||
isc_app_shutdown();
|
||||
|
|
|
|||
Loading…
Reference in a new issue