2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Fix the data race when read-writing sock->active by using cmpxchg

This commit is contained in:
Ondřej Surý
2020-10-22 10:07:56 +02:00
committed by Evan Hunt
parent 5ef71c420f
commit 8797e5efd5
6 changed files with 49 additions and 28 deletions

View File

@@ -544,7 +544,7 @@ isc__nm_async_tcpdnssend(isc__networker_t *worker, isc__netievent_t *ev0) {
REQUIRE(worker->id == sock->tid);
REQUIRE(sock->tid == isc_nm_tid());
if (atomic_load(&sock->active) && sock->outerhandle != NULL) {
if (isc__nmsocket_active(sock) && sock->outerhandle != NULL) {
isc_nmhandle_t *sendhandle = NULL;
isc_region_t r;