When named is being reconfigured, it detaches from the old
'isc_tlsctx_cache_t' TLS context cache object and creates a
new one. This can cause an assertion failure within the
resolver when the object is destroyed while still in use,
because the resolver is using the object without getting
attached to it.
Add an attach/detach so that the 'isc_tlsctx_cache_t' doesn't
get destroyed while still being in use.
isc_hashmap_destroy(&res->counters);
isc_rwlock_destroy(&res->counters_lock);
+ isc_tlsctx_cache_detach(&res->tlsctx_cache);
+
if (res->dispatches4 != NULL) {
dns_dispatchset_destroy(&res->dispatches4);
}
*res = (dns_resolver_t){
.rdclass = view->rdclass,
.options = options,
- .tlsctx_cache = tlsctx_cache,
.spillatmin = 10,
.spillat = 10,
.spillatmax = 100,
res->nloops);
}
+ isc_tlsctx_cache_attach(tlsctx_cache, &res->tlsctx_cache);
+
isc_mutex_init(&res->lock);
isc_mutex_init(&res->primelock);