]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fixup! fixup! fixup! fixup! fixup! Add slabheader foreach macro
authorAlessio Podda <alessio@isc.org>
Wed, 3 Sep 2025 22:31:15 +0000 (00:31 +0200)
committerAlessio Podda <alessio@isc.org>
Wed, 3 Sep 2025 22:31:15 +0000 (00:31 +0200)
lib/dns/qpzone.c

index 45c0b2e548567e59ef5d920dc1ebfdddb2ea9030..86799fd3c50c69dc62298e81349e7471b193c72a 100644 (file)
@@ -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) {