From: Michał Kępień Date: Tue, 28 Feb 2023 08:16:05 +0000 (+0100) Subject: Fix DNSRPS code after struct dns_db refactoring X-Git-Tag: v9.19.11~15^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df3062ed52b67b2128576d8a6524df6f026c12de;p=thirdparty%2Fbind9.git Fix DNSRPS code after struct dns_db refactoring 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. --- diff --git a/lib/dns/dnsrps.c b/lib/dns/dnsrps.c index 1c3800bb98a..c93dc1c8740 100644 --- a/lib/dns/dnsrps.c +++ b/lib/dns/dnsrps.c @@ -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,