From cc5224205551e809cc7c9f4cc76adeb555e274e7 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 31 Jan 2012 22:31:46 +0000 Subject: [PATCH] 3274. [bug] Log when a zone is not reusable. Only set loadtime on successful loads. [RT #27650] --- CHANGES | 3 +++ bin/named/zoneconf.c | 19 ++++++++++++++----- lib/dns/zone.c | 7 +++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 46ece1318c..1d957abc71 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3274. [bug] Log when a zone is not reusable. Only set loadtime + on successful loads. [RT #27650] + 3273. [bug] AAAA responses could be returned in the additional section even when filter-aaaa-on-v4 was in use. [RT #27292] diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index ce4e38237e..60b81f1e8a 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.170.14.5 2011/12/20 00:12:10 marka Exp $ */ +/* $Id: zoneconf.c,v 1.170.14.6 2012/01/31 22:31:46 marka Exp $ */ /*% */ @@ -1465,15 +1465,21 @@ ns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) { zoptions = cfg_tuple_get(zconfig, "options"); - if (zonetype_fromconfig(zoptions) != dns_zone_gettype(zone)) + if (zonetype_fromconfig(zoptions) != dns_zone_gettype(zone)) { + dns_zone_log(zone, ISC_LOG_DEBUG(1), + "not reusable: type mismatch"); return (ISC_FALSE); + } /* * We always reconfigure a static-stub zone for simplicity, assuming * the amount of data to be loaded is small. */ - if (zonetype_fromconfig(zoptions) == dns_zone_staticstub) + if (zonetype_fromconfig(zoptions) == dns_zone_staticstub) { + dns_zone_log(zone, ISC_LOG_DEBUG(1), + "not reusable: staticstub"); return (ISC_FALSE); + } obj = NULL; (void)cfg_map_get(zoptions, "file", &obj); @@ -1484,8 +1490,11 @@ ns_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) { zfilename = dns_zone_getfile(zone); if (!((cfilename == NULL && zfilename == NULL) || (cfilename != NULL && zfilename != NULL && - strcmp(cfilename, zfilename) == 0))) - return (ISC_FALSE); + strcmp(cfilename, zfilename) == 0))) { + dns_zone_log(zone, ISC_LOG_DEBUG(1), + "not reusable: filename mismatch"); + return (ISC_FALSE); + } return (ISC_TRUE); } diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 511b80401c..03ea957475 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.582.8.41 2012/01/30 00:17:23 marka Exp $ */ +/* $Id: zone.c,v 1.582.8.42 2012/01/31 22:31:46 marka Exp $ */ /*! \file */ @@ -3397,9 +3397,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, needdump = ISC_TRUE; } - zone->loadtime = loadtime; - - dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded"); + dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded; checking validity"); /* * Obtain ns, soa and cname counts for top of zone. */ @@ -3644,6 +3642,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, dns_zone_log(zone, ISC_LOG_INFO, "loaded serial %u%s", serial, dns_db_issecure(db) ? " (DNSSEC signed)" : ""); + zone->loadtime = loadtime; return (result); cleanup: