]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup weird syntax defining struct dns_ixfr
authorOndřej Surý <ondrej@isc.org>
Sat, 31 Jan 2026 06:32:08 +0000 (07:32 +0100)
committerOndřej Surý <ondrej@isc.org>
Mon, 16 Mar 2026 11:17:06 +0000 (12:17 +0100)
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.

lib/dns/qpzone.c
lib/dns/xfrin.c

index 8d012d2f2577ace0f5c7b729dea028ef467084e0..2993d833c014d5711001e5afdfd0633fc2925959 100644 (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);
index 902abc34d925b47850b836d2c094bc7d3cc8b8d6..3ecac7528152f13d841c6128b74630fdfd5e5e4e 100644 (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;