From: Alessio Podda Date: Wed, 3 Sep 2025 22:31:15 +0000 (+0200) Subject: fixup! fixup! fixup! fixup! fixup! Add slabheader foreach macro X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eafd2eb93048513407b810a30fdf506ab63d3860;p=thirdparty%2Fbind9.git fixup! fixup! fixup! fixup! fixup! Add slabheader foreach macro --- diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 45c0b2e5485..86799fd3c50 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -4029,26 +4029,26 @@ rdatasetiter_first(dns_rdatasetiter_t *iterator DNS__DB_FLARG) { isc_rwlocktype_t nlocktype = isc_rwlocktype_none; isc_rwlock_t *nlock = qpzone_get_lock(node); - qrditer->currenttop = NULL; - qrditer->current = NULL; - NODE_RDLOCK(nlock, &nlocktype); - DNS_SLABTOP_FOREACH(top, node->data) { - dns_slabheader_t *header = top->header; - while (header != NULL && - (IGNORE(header) || header->serial > version->serial)) - { - header = header->down; - } + qrditer->currenttop = NULL; + qrditer->current = NULL; - if (header != NULL && EXISTS(header)) { - qrditer->currenttop = top; - qrditer->current = header; - break; + DNS_SLABTOP_FOREACH(top, node->data) { + SLABHEADER_FOREACH_SAFE(top->header, header, down) { + if (header->serial <= version->serial && !IGNORE(header)) { + if (EXISTS(header)) { + qrditer->currenttop = top; + qrditer->current = header; + goto exit; + } else { + break; + } + } } } +exit: NODE_UNLOCK(nlock, &nlocktype); if (qrditer->currenttop == NULL) {