]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Lock zone when incrementing statistics
authorMatthijs Mekking <matthijs@isc.org>
Fri, 20 Mar 2026 10:13:27 +0000 (11:13 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 8 Apr 2026 12:24:17 +0000 (14:24 +0200)
dns__zone_stats_increment() requires the zone to be locked. This was
not always the case. This commit fixes that.

lib/dns/zone.c

index fe565033bfc1948853688db21df40696919e019c..27c5ffcf067579cbbe89fd7247fa82f7251cbda0 100644 (file)
@@ -13485,10 +13485,10 @@ dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
        {
                /* Accept notify. */
        } else if (i >= dns_remote_count(&zone->primaries)) {
-               UNLOCK_ZONE(zone);
                dns_zone_logc(zone, DNS_LOGCATEGORY_XFER_IN, ISC_LOG_INFO,
                              "refused notify from non-primary: %s", fromtext);
                dns__zone_stats_increment(zone, dns_zonestatscounter_notifyrej);
+               UNLOCK_ZONE(zone);
                return DNS_R_REFUSED;
        }