]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Compute transaction size based on journal/transaction type
authorMark Andrews <marka@isc.org>
Thu, 1 Apr 2021 04:30:42 +0000 (15:30 +1100)
committerOndřej Surý <ondrej@isc.org>
Wed, 7 Apr 2021 18:20:57 +0000 (20:20 +0200)
previously the code assumed that it was a new transaction.

lib/dns/journal.c

index cbc5a1c7f2b4ba42ac9b92146a4d18a106c287e8..0beea59ca9dc633f5b43597e1b4eb641ff97e5aa 100644 (file)
@@ -1318,7 +1318,8 @@ dns_journal_commit(dns_journal_t *j) {
        if (j->state == JOURNAL_STATE_TRANSACTION) {
                isc_offset_t offset;
                offset = (j->x.pos[1].offset - j->x.pos[0].offset) -
-                        sizeof(journal_rawxhdr_t);
+                        (j->header_ver1 ? sizeof(journal_rawxhdr_ver1_t)
+                                        : sizeof(journal_rawxhdr_t));
                /*
                 * Update the transaction header.
                 */