2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00

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.
This commit is contained in:
David Lawrence
2000-12-13 07:18:44 +00:00
parent fa67ca21f6
commit 3d509f54ac
3 changed files with 19 additions and 8 deletions

View File

@@ -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 612. [cleanup] Shutup a ridiculously noisy HP-UX compiler that
complains relentlessly about how its treatment complains relentlessly about how its treatment
of 'const' has changed as well as how casting of 'const' has changed as well as how casting

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * 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 <config.h> #include <config.h>
@@ -2226,6 +2226,7 @@ isc_result_t
ns_server_reloadcommand(ns_server_t *server, char *args) { ns_server_reloadcommand(ns_server_t *server, char *args) {
isc_result_t result; isc_result_t result;
dns_zone_t *zone = NULL; dns_zone_t *zone = NULL;
dns_zonetype_t type;
UNUSED(server); UNUSED(server);
result = zone_from_args(server, args, &zone); result = zone_from_args(server, args, &zone);
@@ -2234,7 +2235,11 @@ ns_server_reloadcommand(ns_server_t *server, char *args) {
if (zone == NULL) { if (zone == NULL) {
ns_server_reloadwanted(server); ns_server_reloadwanted(server);
} else { } 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); dns_zone_detach(&zone);
} }
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * 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 <config.h> #include <config.h>
@@ -243,7 +243,7 @@ struct dns_zone {
* from SOA (if not set, we * from SOA (if not set, we
* are still using * are still using
* default timer values) */ * 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_NOREFRESH 0x00010000U
#define DNS_ZONEFLG_DIALNOTIFY 0x00020000U #define DNS_ZONEFLG_DIALNOTIFY 0x00020000U
#define DNS_ZONEFLG_DIALREFRESH 0x00040000U #define DNS_ZONEFLG_DIALREFRESH 0x00040000U
@@ -863,6 +863,8 @@ dns_zone_getjournal(dns_zone_t *zone) {
*/ */
static isc_boolean_t static isc_boolean_t
zone_isdynamic(dns_zone_t *zone) { zone_isdynamic(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (ISC_TF(zone->type == dns_zone_slave || return (ISC_TF(zone->type == dns_zone_slave ||
zone->type == dns_zone_stub || zone->type == dns_zone_stub ||
zone->ssutable != NULL || 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", zone_log(zone, me, ISC_LOG_DEBUG(1), "Serial: new %u, old %u",
serial, zone->serial); serial, zone->serial);
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) || 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)) { isc_serial_gt(serial, zone->serial)) {
tcp_transfer: tcp_transfer:
isc_event_free(&event); 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); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY);
/*FALLTHROUGH*/ /*FALLTHROUGH*/
case DNS_R_UPTODATE: case DNS_R_UPTODATE:
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FORCELOAD); DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FORCEXFER);
/* /*
* Has the zone expired underneath us? * Has the zone expired underneath us?
*/ */
@@ -5738,7 +5740,7 @@ dns_zone_forcereload(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone); LOCK_ZONE(zone);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FORCELOAD); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FORCEXFER);
UNLOCK_ZONE(zone); UNLOCK_ZONE(zone);
dns_zone_refresh(zone); dns_zone_refresh(zone);
} }
@@ -5747,7 +5749,7 @@ isc_boolean_t
dns_zone_isforced(dns_zone_t *zone) { dns_zone_isforced(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(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 isc_result_t