mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-13 22:22:08 -04:00
3010. [bug] Fixed a bug where "rndc reconfig" stopped the timer
for refreshing managed-keys. [RT #22296]
This commit is contained in:
parent
7b6f57b947
commit
4bfb1e97f5
3 changed files with 31 additions and 6 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
3010. [bug] Fixed a bug where "rndc reconfig" stopped the timer
|
||||
for refreshing managed-keys. [RT #22296]
|
||||
|
||||
3009. [bug] clients-per-query code didn't work as expected with
|
||||
particular query patterns. [RT #22972]
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: server.c,v 1.599 2011/01/13 03:57:50 marka Exp $ */
|
||||
/* $Id: server.c,v 1.599.8.1 2011/02/03 00:20:50 each Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
|
|
@ -3447,6 +3447,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
|
|||
static isc_result_t
|
||||
add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
|
||||
isc_result_t result;
|
||||
dns_view_t *pview = NULL;
|
||||
dns_zone_t *zone = NULL;
|
||||
dns_acl_t *none = NULL;
|
||||
char filename[PATH_MAX];
|
||||
|
|
@ -3455,8 +3456,22 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
|
|||
|
||||
REQUIRE(view != NULL);
|
||||
|
||||
CHECK(dns_zone_create(&zone, mctx));
|
||||
/* See if we can re-use an existing keydata zone. */
|
||||
result = dns_viewlist_find(&ns_g_server->viewlist,
|
||||
view->name, view->rdclass,
|
||||
&pview);
|
||||
if (result != ISC_R_NOTFOUND &&
|
||||
result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
if (pview != NULL && pview->managed_keys != NULL) {
|
||||
dns_zone_attach(pview->managed_keys, &view->managed_keys);
|
||||
dns_view_detach(&pview);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/* No existing keydata zone was found; create one */
|
||||
CHECK(dns_zone_create(&zone, mctx));
|
||||
CHECK(dns_zone_setorigin(zone, dns_rootname));
|
||||
|
||||
isc_sha256_data((void *)view->name, strlen(view->name), buffer);
|
||||
|
|
@ -5020,11 +5035,14 @@ load_new_zones(ns_server_t *server, isc_boolean_t stop) {
|
|||
view = ISC_LIST_NEXT(view, link))
|
||||
{
|
||||
CHECK(dns_view_loadnew(view, stop));
|
||||
|
||||
/* Load managed-keys data */
|
||||
if (view->managed_keys != NULL)
|
||||
CHECK(dns_zone_loadnew(view->managed_keys));
|
||||
}
|
||||
|
||||
/*
|
||||
* Force zone maintenance. Do this after loading
|
||||
* so that we know when we need to force AXFR of
|
||||
* slave zones whose master files are missing.
|
||||
* Resume zone XFRs.
|
||||
*/
|
||||
dns_zonemgr_resumexfrs(server->zonemgr);
|
||||
cleanup:
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: zone.c,v 1.582 2011/01/13 04:59:25 tbox Exp $ */
|
||||
/* $Id: zone.c,v 1.582.8.1 2011/02/03 00:20:51 each Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
|
|
@ -2682,6 +2682,7 @@ set_refreshkeytimer(dns_zone_t *zone, dns_rdata_keydata_t *key,
|
|||
const char me[] = "set_refreshkeytimer";
|
||||
isc_stdtime_t then;
|
||||
isc_time_t timenow, timethen;
|
||||
char timebuf[80];
|
||||
|
||||
ENTER;
|
||||
then = key->refresh;
|
||||
|
|
@ -2698,6 +2699,9 @@ set_refreshkeytimer(dns_zone_t *zone, dns_rdata_keydata_t *key,
|
|||
if (isc_time_compare(&zone->refreshkeytime, &timenow) < 0 ||
|
||||
isc_time_compare(&timethen, &zone->refreshkeytime) < 0)
|
||||
zone->refreshkeytime = timethen;
|
||||
|
||||
isc_time_formattimestamp(&zone->refreshkeytime, timebuf, 80);
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1), "next key refresh: %s", timebuf);
|
||||
zone_settimer(zone, &timenow);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue