]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix DNSRPS code after struct dns_db refactoring
authorMichał Kępień <michal@isc.org>
Tue, 28 Feb 2023 08:16:05 +0000 (09:16 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 28 Feb 2023 08:16:05 +0000 (09:16 +0100)
Commits ffa4757c792579e3bc8316df6ce4f47093e0bde3 and
77e7eac54c51c5e23bf6e0349237442ea105d02a inadvertently broke
DNSRPS-enabled builds:

  - the new member of struct dns_db that holds a reference count for the
    database is called 'references', not 'refcount',

  - a syntax error was introduced in the designated initializer for
    'rpsdb_rdataset_methods',

  - rpsdb_destroy() no longer takes a 'dbp' argument.

Address all of the above issues to make DNSRPS-enabled builds work
again.

lib/dns/dnsrps.c

index 1c3800bb98aca88240adf92329f93deb29920763..c93dc1c874036f00eae0340f43656d8fe8852667 100644 (file)
@@ -265,7 +265,7 @@ dns_dnsrps_rewrite_init(librpz_emsg_t *emsg, dns_rpz_st_t *st,
                },
                .qname = qname,
        };
-       isc_refcount_init(&rpsdb->common.refcount, 1);
+       isc_refcount_init(&rpsdb->common.references, 1);
 
        if (!librpz->rsp_create(emsg, &rpsdb->rsp, NULL, rpzs->rps_client,
                                have_rd, false))
@@ -367,10 +367,8 @@ rpsdb_destroy(dns_db_t *db) {
 
        REQUIRE(VALID_RPSDB(rpsdb));
 
-       *dbp = NULL;
-
        librpz->rsp_detach(&rpsdb->rsp);
-       isc_refcount_destroy(&rpsdb->common.refcount);
+       isc_refcount_destroy(&rpsdb->common.references);
        rpsdb->common.impmagic = 0;
        isc_mem_putanddetach(&rpsdb->common.mctx, rpsdb, sizeof(*rpsdb));
 }
@@ -383,7 +381,7 @@ rpsdb_attachnode(dns_db_t *db, dns_dbnode_t *source, dns_dbnode_t **targetp) {
        REQUIRE(targetp != NULL && *targetp == NULL);
        REQUIRE(source == &rpsdb->origin_node || source == &rpsdb->data_node);
 
-       isc_refcount_increment(&rpsdb->common.refcount);
+       isc_refcount_increment(&rpsdb->common.references);
        *targetp = source;
 }
 
@@ -921,7 +919,7 @@ static dns_dbmethods_t rpsdb_db_methods = {
 
 static dns_rdatasetmethods_t rpsdb_rdataset_methods = {
        .disassociate = rpsdb_rdataset_disassociate,
-       first = rpsdb_rdataset_first,
+       .first = rpsdb_rdataset_first,
        .next = rpsdb_rdataset_next,
        .current = rpsdb_rdataset_current,
        .clone = rpsdb_rdataset_clone,