diff --git a/CHANGES b/CHANGES index 3ce30a7658..920117a9d8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ + 613. [bug] "rndc reload zone" now reloads primary zones. + It previously only updated slave and stub zones, + if an SOA query indicated an out of date serial. + 612. [cleanup] Shutup a ridiculously noisy HP-UX compiler that complains relentlessly about how its treatment of 'const' has changed as well as how casting diff --git a/bin/named/server.c b/bin/named/server.c index e24cc000f9..c6e9534dd0 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.272 2000/12/12 23:05:56 bwelling Exp $ */ +/* $Id: server.c,v 1.273 2000/12/13 07:18:42 tale Exp $ */ #include @@ -2226,6 +2226,7 @@ isc_result_t ns_server_reloadcommand(ns_server_t *server, char *args) { isc_result_t result; dns_zone_t *zone = NULL; + dns_zonetype_t type; UNUSED(server); result = zone_from_args(server, args, &zone); @@ -2234,7 +2235,11 @@ ns_server_reloadcommand(ns_server_t *server, char *args) { if (zone == NULL) { ns_server_reloadwanted(server); } else { - dns_zone_forcereload(zone); + type = dns_zone_gettype(zone); + if (type == dns_zone_slave || type == dns_zone_stub) + dns_zone_refresh(zone); + else + dns_zone_load(zone); dns_zone_detach(&zone); } return (ISC_R_SUCCESS); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index f89948c1ba..923d390ed6 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.278 2000/12/13 06:21:42 marka Exp $ */ +/* $Id: zone.c,v 1.279 2000/12/13 07:18:44 tale Exp $ */ #include @@ -243,7 +243,7 @@ struct dns_zone { * from SOA (if not set, we * are still using * default timer values) */ -#define DNS_ZONEFLG_FORCELOAD 0x00008000U /* Force a reload */ +#define DNS_ZONEFLG_FORCEXFER 0x00008000U /* Force a zone xfer */ #define DNS_ZONEFLG_NOREFRESH 0x00010000U #define DNS_ZONEFLG_DIALNOTIFY 0x00020000U #define DNS_ZONEFLG_DIALREFRESH 0x00040000U @@ -863,6 +863,8 @@ dns_zone_getjournal(dns_zone_t *zone) { */ static isc_boolean_t zone_isdynamic(dns_zone_t *zone) { + REQUIRE(DNS_ZONE_VALID(zone)); + return (ISC_TF(zone->type == dns_zone_slave || zone->type == dns_zone_stub || zone->ssutable != NULL || @@ -3162,7 +3164,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) { zone_log(zone, me, ISC_LOG_DEBUG(1), "Serial: new %u, old %u", serial, zone->serial); if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) || - DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCELOAD) || + DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCEXFER) || isc_serial_gt(serial, zone->serial)) { tcp_transfer: isc_event_free(&event); @@ -4564,7 +4566,7 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) { DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY); /*FALLTHROUGH*/ case DNS_R_UPTODATE: - DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FORCELOAD); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FORCEXFER); /* * Has the zone expired underneath us? */ @@ -5738,7 +5740,7 @@ dns_zone_forcereload(dns_zone_t *zone) { REQUIRE(DNS_ZONE_VALID(zone)); LOCK_ZONE(zone); - DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FORCELOAD); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FORCEXFER); UNLOCK_ZONE(zone); dns_zone_refresh(zone); } @@ -5747,7 +5749,7 @@ isc_boolean_t dns_zone_isforced(dns_zone_t *zone) { REQUIRE(DNS_ZONE_VALID(zone)); - return (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCELOAD)); + return (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FORCEXFER)); } isc_result_t