mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
preserve cache when reload fails
If the server is reloaded, new views are created and preexisting cache
is attached to those _but_ something goes wrong later, the previous
views are restored but the previous cache list is destroyed. This makes
the subsequent reload to drop the existing cache. This fixes it by
avoiding a mutation of the old cache list.
(cherry picked from commit a1703fa35b)
This commit is contained in:
parent
56fa811fe5
commit
a4c3e6f3dd
1 changed files with 8 additions and 6 deletions
|
|
@ -4839,13 +4839,15 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
dns_cache_getname(nsc->cache));
|
||||
nsc = NULL;
|
||||
} else {
|
||||
if (oldcache) {
|
||||
ISC_LIST_UNLINK(*oldcachelist, nsc, link);
|
||||
ISC_LIST_APPEND(*cachelist, nsc, link);
|
||||
nsc->primaryview = view;
|
||||
}
|
||||
dns_cache_attach(nsc->cache, &cache);
|
||||
shared_cache = true;
|
||||
dns_cache_attach(nsc->cache, &cache);
|
||||
if (oldcache) {
|
||||
/*
|
||||
* We need to re-use the cache, but we don't
|
||||
* want to mutate the old production list.
|
||||
*/
|
||||
nsc = NULL;
|
||||
}
|
||||
}
|
||||
} else if (strcmp(cachename, view->name) == 0) {
|
||||
result = dns_viewlist_find(&named_g_server->viewlist, cachename,
|
||||
|
|
|
|||
Loading…
Reference in a new issue