From: Ondřej Surý Date: Sat, 31 Jan 2026 06:32:08 +0000 (+0100) Subject: Cleanup weird syntax defining struct dns_ixfr X-Git-Tag: v9.21.21~37^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e286beaa6edf3085ad17dd07db7b99d7d985169;p=thirdparty%2Fbind9.git Cleanup weird syntax defining struct dns_ixfr The struct dns_ixfr was defined as part of struct dns_xfrin, probably because at some point it was an anonymous struct and then it was changed to named struct with typedef at the top. Move the definition from struct dns_xfrin into and fold into the typedef ... dns_ixfr_t. --- diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 8d012d2f257..2993d833c01 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -4679,6 +4679,9 @@ qpzone_createiterator(dns_db_t *db, unsigned int options, * The reason this is split from qpzone_addrdataset is to allow the reuse of * the same qp transaction for multiple adds. * + * If the rdataset is of type NSEC, 'nsec' must point to the qp trie for the + * zone, otherwise it must be NULL. + * * qpzone_subtractrdataset doesn't have the same problem since it cannot delete * nodes, only rdatasets. */ @@ -4746,9 +4749,9 @@ qpzone_addrdataset_inner(qpzonedb_t *qpdb, qpznode_t *node, } /* - * If we're adding a delegation type or adding NSEC records - * tree hold an exclusive lock on the tree. In the latter case the - * lock does not necessarily have to be acquired but it will help + * If we're adding a delegation type or adding to the auxiliary NSEC + * namespace, hold an exclusive lock on the tree. In the latter case + * the lock does not necessarily have to be acquired but it will help * purge ancient entries more effectively. * * (Note: node lock must be acquired after starting @@ -4810,7 +4813,8 @@ qpzone_addrdataset(dns_db_t *db, dns_dbnode_t *dbnode, REQUIRE(VALID_QPZONE(qpdb)); /* - * Open a new write transaction if we're adding an NSEC record. + * Open a new write transaction if we're adding to the auxiliary + * NSEC namespace. */ if (!node->havensec && rdataset->type == dns_rdatatype_nsec) { dns_qpmulti_write(qpdb->tree, &nsec); diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 902abc34d92..3ecac752815 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -80,7 +80,13 @@ typedef enum { * Incoming zone transfer context. */ -typedef struct dns_ixfr dns_ixfr_t; +typedef struct dns_ixfr { + uint32_t diffs; + uint32_t maxdiffs; + uint32_t request_serial; + uint32_t current_serial; + dns_journal_t *journal; +} dns_ixfr_t; struct dns_xfrin { unsigned int magic; @@ -174,13 +180,7 @@ struct dns_xfrin { */ dns_rdatacallbacks_t axfr; - struct dns_ixfr { - uint32_t diffs; - uint32_t maxdiffs; - uint32_t request_serial; - uint32_t current_serial; - dns_journal_t *journal; - } ixfr; + dns_ixfr_t ixfr; dns_rdata_t firstsoa; unsigned char *firstsoa_data;