LOCK(&catzs->lock);
+ /*
+ * This function is called only during a (re)configuration, while
+ * 'catzs->zones' can become NULL only during shutdown.
+ */
+ INSIST(catzs->zones != NULL);
+ INSIST(!atomic_load(&catzs->shuttingdown));
+
result = dns_catz_new_zone(catzs, &catz, name);
if (result != ISC_R_SUCCESS) {
goto cleanup;
REQUIRE(ISC_MAGIC_VALID(name, DNS_NAME_MAGIC));
LOCK(&catzs->lock);
+ if (catzs->zones == NULL) {
+ UNLOCK(&catzs->lock);
+ return (NULL);
+ }
result = isc_ht_find(catzs->zones, name->ndata, name->length,
(void **)&found);
UNLOCK(&catzs->lock);
*/
dns_name_toregion(&updb->origin, &r);
LOCK(&catzs->lock);
+ if (catzs->zones == NULL) {
+ UNLOCK(&catzs->lock);
+ result = ISC_R_SHUTTINGDOWN;
+ goto exit;
+ }
result = isc_ht_find(catzs->zones, r.base, r.length, (void **)&oldcatz);
is_active = (result == ISC_R_SUCCESS && oldcatz->active);
UNLOCK(&catzs->lock);
dns_catz_add_zone(dns_catz_zones_t *catzs, const dns_name_t *name,
dns_catz_zone_t **catzp);
/*%<
- * Allocate a new catz named 'name' and put it in 'catzs' collection.
+ * Allocate a new catz named 'name' and put it in 'catzs' collection. This
+ * function is safe to call only during a (re)configuration.
*
* Requires:
* \li 'catzs' is a valid dns_catz_zones_t.