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.
This commit is contained in:
Ondřej Surý 2026-01-31 07:32:08 +01:00
parent f4b4f030c4
commit 6e286beaa6
2 changed files with 16 additions and 12 deletions

View file

@ -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);

View file

@ -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;