Lock zone when incrementing statistics

dns__zone_stats_increment() requires the zone to be locked. This was
not always the case. This commit fixes that.
This commit is contained in:
Matthijs Mekking 2026-03-20 11:13:27 +01:00
parent d3eba4e78f
commit 1a0b419991

View 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;
}