]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use journal_write_xhdr() to write the dummy transaction header
authorMark Andrews <marka@isc.org>
Wed, 31 Mar 2021 02:29:13 +0000 (13:29 +1100)
committerOndřej Surý <ondrej@isc.org>
Wed, 7 Apr 2021 18:18:44 +0000 (20:18 +0200)
Instead of journal_write(), use correct format call journal_write_xhdr()
to write the dummy transaction header which looks at j->header_ver1 to
determine which transaction header to write instead of always writing a
zero filled journal_rawxhdr_t header.

lib/dns/journal.c

index b15e77e0fba14b2c90af8639ef4ee3c1bfa75e82..cbc5a1c7f2b4ba42ac9b92146a4d18a106c287e8 100644 (file)
@@ -1101,7 +1101,6 @@ isc_result_t
 dns_journal_begin_transaction(dns_journal_t *j) {
        uint32_t offset;
        isc_result_t result;
-       journal_rawxhdr_t hdr;
 
        REQUIRE(DNS_JOURNAL_VALID(j));
        REQUIRE(j->state == JOURNAL_STATE_WRITE ||
@@ -1128,8 +1127,7 @@ dns_journal_begin_transaction(dns_journal_t *j) {
         * space.  It will be filled in when the transaction is
         * finished.
         */
-       memset(&hdr, 0, sizeof(hdr));
-       CHECK(journal_write(j, &hdr, sizeof(hdr)));
+       CHECK(journal_write_xhdr(j, 0, 0, 0, 0));
        j->x.pos[1].offset = j->offset;
 
        j->state = JOURNAL_STATE_TRANSACTION;