]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use update_recordsandbytes in rbt_datafixer
authorMark Andrews <marka@isc.org>
Tue, 19 Nov 2019 03:46:08 +0000 (14:46 +1100)
committerOndřej Surý <ondrej@isc.org>
Tue, 19 Nov 2019 16:59:12 +0000 (00:59 +0800)
(cherry picked from commit 7d4d64340ea1e8f15b28f634be0052438fe0f936)

lib/dns/rbtdb.c

index 52fad3a08eed5c35ad313790439a94e6d23cf0ee..2da368238ce26600d68fc3629dceed06879f1154 100644 (file)
@@ -7125,12 +7125,6 @@ rbt_datafixer(dns_rbtnode_t *rbtnode, void *base, size_t filesize,
        for (header = rbtnode->data; header != NULL; header = header->next) {
                unsigned char *p = (unsigned char *) header;
                size_t size = dns_rdataslab_size(p, sizeof(*header));
-               unsigned int count = dns_rdataslab_count(p, sizeof(*header));;
-               RWLOCK(&rbtdb->current_version->rwlock, isc_rwlocktype_write);
-               rbtdb->current_version->records += count;
-               rbtdb->current_version->bytes += size;
-               RWUNLOCK(&rbtdb->current_version->rwlock,
-                        isc_rwlocktype_write);
                isc_crc64_update(crc, p, size);
 #ifdef DEBUG
                hexdump("hashing header", p, sizeof(rdatasetheader_t));
@@ -7162,6 +7156,7 @@ rbt_datafixer(dns_rbtnode_t *rbtnode, void *base, size_t filesize,
                            (header->next > (rdatasetheader_t *) limit))
                                return (ISC_R_INVALIDFILE);
                }
+               update_recordsandbytes(true, rbtdb->current_version, header);
        }
 
        return (ISC_R_SUCCESS);