]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't stop timer from dns__nta_shutdown()
authorOndřej Surý <ondrej@isc.org>
Fri, 30 Sep 2022 08:52:14 +0000 (10:52 +0200)
committerOndřej Surý <ondrej@isc.org>
Fri, 30 Sep 2022 13:24:20 +0000 (15:24 +0200)
The dns__nta_shutdown() could be run from different threads and it was
accessing nta->timer unlocked.  Don't check and stop the timer from
dns__nta_shutdown() directly, but leave it for the async callback.

lib/dns/nta.c

index 1b80f1cbdb5acfe943c0300e3a0f8e6f3c6ec004..1d141ea27cb0979f590678cd4f151269a920f151 100644 (file)
@@ -645,7 +645,7 @@ dns__nta_shutdown_cb(dns__nta_t *nta) {
        REQUIRE(VALID_NTA(nta));
 
        if (nta->timer) {
-               isc_timer_stop(nta->timer); /* This is superfluous */
+               isc_timer_stop(nta->timer);
                isc_timer_destroy(&nta->timer);
        }
 
@@ -656,10 +656,6 @@ static void
 dns__nta_shutdown(dns__nta_t *nta) {
        REQUIRE(VALID_NTA(nta));
 
-       if (nta->timer != NULL) {
-               isc_timer_stop(nta->timer);
-       }
-
        dns__nta_ref(nta);
        isc_async_run(nta->loop, (isc_job_cb)dns__nta_shutdown_cb, nta);
 }