]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check view->adb in dns_view_flushcache()
authorOndřej Surý <ondrej@isc.org>
Thu, 10 Nov 2022 08:30:52 +0000 (09:30 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 11 Nov 2022 10:47:44 +0000 (11:47 +0100)
The call to dns_view_flushcache() is done under exclusive mode, but we
still need to check if view->adb is still attached before calling
dns_adb_flush() because the shutdown might have been already
initialized.  This most likely only a theoretical problem on shutdown
because there's either no way how to initiate cache flush when shutting
down or very slim window where the `rndc flush` would have to hit the
slim time during named shutdown.

lib/dns/view.c

index e2cd0c1577b3100a5f31fd757dfca132ab907b6b..8fcf23345ca47d543f128629eb9a083796f1b3b3 100644 (file)
@@ -1528,7 +1528,10 @@ dns_view_flushcache(dns_view_t *view, bool fixuponly) {
                dns_badcache_flush(view->failcache);
        }
 
-       dns_adb_flush(view->adb);
+       if (view->adb) {
+               dns_adb_flush(view->adb);
+       }
+
        return (ISC_R_SUCCESS);
 }