]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a debug log in zone.c:refresh_callback()
authorAram Sargsyan <aram@isc.org>
Wed, 21 May 2025 14:56:04 +0000 (14:56 +0000)
committerOndřej Surý <ondrej@isc.org>
Wed, 28 May 2025 17:18:19 +0000 (19:18 +0200)
The new debug message logs the request result in the SOA request
callback function.

(cherry picked from commit b07ec4f0b3429f688d35d2694f56cffc9d3ac56b)

lib/dns/zone.c

index bf0ba0ecadb3876416d09efdc2c0c2bb67583105..816e801bf7fe41397619180c8776000bcd83233a 100644 (file)
@@ -13919,6 +13919,7 @@ refresh_callback(void *arg) {
        dns_rdata_t rdata = DNS_RDATA_INIT;
        dns_rdata_soa_t soa;
        isc_result_t result;
+       const isc_result_t eresult = dns_request_getresult(request);
        isc_sockaddr_t curraddr;
        uint32_t serial, oldserial = 0;
        bool do_queue_xfrin = false;
@@ -13927,6 +13928,12 @@ refresh_callback(void *arg) {
 
        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();
 
        LOCK_ZONE(zone);
@@ -13942,7 +13949,7 @@ refresh_callback(void *arg) {
        isc_sockaddr_format(&curraddr, primary, sizeof(primary));
        isc_sockaddr_format(&zone->sourceaddr, source, sizeof(source));
 
-       switch (dns_request_getresult(request)) {
+       switch (eresult) {
        case ISC_R_SUCCESS:
                break;
        case ISC_R_SHUTTINGDOWN:
@@ -13988,7 +13995,7 @@ refresh_callback(void *arg) {
                }
                FALLTHROUGH;
        default:
-               result = dns_request_getresult(request);
+               result = eresult;
                dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_INFO,
                              "refresh: failure trying primary "
                              "%s (source %s): %s",