2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Provide a mechanism to return the expire option value

to the zone code so that it can be used to adjust the expire time.
This commit is contained in:
Mark Andrews
2023-06-29 15:52:32 +10:00
parent 0cfe0a61dc
commit 87912e4bb8
3 changed files with 11 additions and 8 deletions

View File

@@ -434,7 +434,7 @@ typedef isc_result_t (*dns_additionaldatafunc_t)(
typedef isc_result_t (*dns_digestfunc_t)(void *, isc_region_t *);
typedef void (*dns_xfrindone_t)(dns_zone_t *, isc_result_t);
typedef void (*dns_xfrindone_t)(dns_zone_t *, uint32_t *, isc_result_t);
typedef void (*dns_updatecallback_t)(void *, isc_result_t, dns_message_t *);

View File

@@ -833,7 +833,7 @@ xfrin_fail(dns_xfrin_t *xfr, isc_result_t result, const char *msg) {
dns_journal_destroy(&xfr->ixfr.journal);
}
if (xfr->done != NULL) {
(xfr->done)(xfr->zone, result);
(xfr->done)(xfr->zone, NULL, result);
xfr->done = NULL;
}
xfr->shutdown_result = result;
@@ -1545,7 +1545,7 @@ xfrin_recv_done(isc_result_t result, isc_region_t *region, void *arg) {
if (xfr->done != NULL) {
LIBDNS_XFRIN_DONE_CALLBACK_BEGIN(xfr, xfr->info,
result);
(xfr->done)(xfr->zone, ISC_R_SUCCESS);
(xfr->done)(xfr->zone, NULL, ISC_R_SUCCESS);
xfr->done = NULL;
LIBDNS_XFRIN_DONE_CALLBACK_END(xfr, xfr->info, result);
}

View File

@@ -862,7 +862,7 @@ zone_catz_disable(dns_zone_t *zone);
static isc_result_t
default_journal(dns_zone_t *zone);
static void
zone_xfrdone(dns_zone_t *zone, isc_result_t result);
zone_xfrdone(dns_zone_t *zone, uint32_t *expireopt, isc_result_t result);
static isc_result_t
zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime,
isc_result_t result);
@@ -17079,7 +17079,7 @@ zone_detachdb(dns_zone_t *zone) {
}
static void
zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
zone_xfrdone(dns_zone_t *zone, uint32_t *expireopt, isc_result_t result) {
isc_time_t now;
bool again = false;
unsigned int soacount;
@@ -17091,8 +17091,11 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
REQUIRE(DNS_ZONE_VALID(zone));
dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_DEBUG(1),
"zone transfer finished: %s", isc_result_totext(result));
dns_zone_logc(
zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_DEBUG(1),
expireopt == NULL ? "zone transfer finished: %s"
: "zone transfer finished: %s, expire=%u",
isc_result_totext(result), expireopt != NULL ? *expireopt : 0);
/*
* Obtaining a lock on the zone->secure (see zone_send_secureserial)
@@ -17715,7 +17718,7 @@ failure:
* zmgr->xfrin_in_progress.
*/
if (result != ISC_R_SUCCESS) {
zone_xfrdone(zone, result);
zone_xfrdone(zone, NULL, result);
}
if (zmgr_tlsctx_cache != NULL) {