2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Add a debug log in zone.c:refresh_callback()

The new debug message logs the request result in the SOA request
callback function.

(cherry picked from commit b07ec4f0b3429f688d35d2694f56cffc9d3ac56b)
This commit is contained in:
Aram Sargsyan 2025-05-21 14:56:04 +00:00 committed by Ondřej Surý
parent 7b46d898b6
commit 0d1251a2ec
No known key found for this signature in database
GPG Key ID: 2820F37E873DEA41

View File

@ -13919,6 +13919,7 @@ refresh_callback(void *arg) {
dns_rdata_t rdata = DNS_RDATA_INIT; dns_rdata_t rdata = DNS_RDATA_INIT;
dns_rdata_soa_t soa; dns_rdata_soa_t soa;
isc_result_t result; isc_result_t result;
const isc_result_t eresult = dns_request_getresult(request);
isc_sockaddr_t curraddr; isc_sockaddr_t curraddr;
uint32_t serial, oldserial = 0; uint32_t serial, oldserial = 0;
bool do_queue_xfrin = false; bool do_queue_xfrin = false;
@ -13927,6 +13928,12 @@ refresh_callback(void *arg) {
ENTER; ENTER;
if (isc_log_wouldlog(dns_lctx, ISC_LOG_DEBUG(3))) {
dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_DEBUG(3),
"refresh: request result: %s",
isc_result_totext(eresult));
}
now = isc_time_now(); now = isc_time_now();
LOCK_ZONE(zone); LOCK_ZONE(zone);
@ -13942,7 +13949,7 @@ refresh_callback(void *arg) {
isc_sockaddr_format(&curraddr, primary, sizeof(primary)); isc_sockaddr_format(&curraddr, primary, sizeof(primary));
isc_sockaddr_format(&zone->sourceaddr, source, sizeof(source)); isc_sockaddr_format(&zone->sourceaddr, source, sizeof(source));
switch (dns_request_getresult(request)) { switch (eresult) {
case ISC_R_SUCCESS: case ISC_R_SUCCESS:
break; break;
case ISC_R_SHUTTINGDOWN: case ISC_R_SHUTTINGDOWN:
@ -13988,7 +13995,7 @@ refresh_callback(void *arg) {
} }
FALLTHROUGH; FALLTHROUGH;
default: default:
result = dns_request_getresult(request); result = eresult;
dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_INFO, dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_INFO,
"refresh: failure trying primary " "refresh: failure trying primary "
"%s (source %s): %s", "%s (source %s): %s",