fix build bug with DNS_RPZ_TRACE

nonstardard naming of ref/unref and attach/detach functions caused
build errors when using DNS_RPZ_TRACE; this has been fixed.
This commit is contained in:
Evan Hunt 2023-09-29 16:16:49 -07:00
parent 8f6a3f47db
commit 86fbfc22b4
5 changed files with 16 additions and 26 deletions

View file

@ -2617,10 +2617,10 @@ configure_rpz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t **maps,
}
if (*old_rpz_okp) {
dns_rpz_shutdown_rpzs(view->rpzs);
dns_rpz_detach_rpzs(&view->rpzs);
dns_rpz_attach_rpzs(pview->rpzs, &view->rpzs);
dns_rpz_detach_rpzs(&pview->rpzs);
dns_rpz_zones_shutdown(view->rpzs);
dns_rpz_zones_detach(&view->rpzs);
dns_rpz_zones_attach(pview->rpzs, &view->rpzs);
dns_rpz_zones_detach(&pview->rpzs);
} else if (old != NULL && pview != NULL) {
++pview->rpzs->rpz_ver;
view->rpzs->rpz_ver = pview->rpzs->rpz_ver;

View file

@ -411,27 +411,17 @@ void
dns_rpz_zones_shutdown(dns_rpz_zones_t *rpzs);
#ifdef DNS_RPZ_TRACE
/* Compatibility macros */
#define dns_rpz_detach_rpzs(rpzsp) \
#define dns_rpz_zones_detach(rpzsp) \
dns_rpz_zones__detach(rpzsp, __func__, __FILE__, __LINE__)
#define dns_rpz_attach_rpzs(rpzs, rpzsp) \
#define dns_rpz_zones_attach(rpzs, rpzsp) \
dns_rpz_zones__attach(rpzs, rpzsp, __func__, __FILE__, __LINE__)
#define dns_rpz_ref_rpzs(ptr) \
#define dns_rpz_zones_ref(ptr) \
dns_rpz_zones__ref(ptr, __func__, __FILE__, __LINE__)
#define dns_rpz_unref_rpzs(ptr) \
#define dns_rpz_zones_unref(ptr) \
dns_rpz_zones__unref(ptr, __func__, __FILE__, __LINE__)
#define dns_rpz_shutdown_rpzs(rpzs) \
dns_rpz_zones_shutdown(rpzs, __func__, __FILE__, __LINE__)
ISC_REFCOUNT_TRACE_DECL(dns_rpz_zones);
#else
/* Compatibility macros */
#define dns_rpz_detach_rpzs(rpzsp) dns_rpz_zones_detach(rpzsp)
#define dns_rpz_attach_rpzs(rpzs, rpzsp) dns_rpz_zones_attach(rpzs, rpzsp)
#define dns_rpz_shutdown_rpzs(rpzsp) dns_rpz_zones_shutdown(rpzsp)
#define dns_rpz_ref_rpzs(ptr) dns_rpz_zones_ref(ptr)
#define dns_rpz_unref_rpzs(ptr) dns_rpz_zones_unref(ptr)
ISC_REFCOUNT_DECL(dns_rpz_zones);
#endif

View file

@ -1680,7 +1680,7 @@ dns__rpz_timer_stop(void *arg) {
isc_timer_destroy(&rpz->updatetimer);
rpz->loop = NULL;
dns_rpz_unref_rpzs(rpz->rpzs);
dns_rpz_zones_unref(rpz->rpzs);
}
static void
@ -1709,7 +1709,7 @@ update_rpz_done_cb(void *data) {
ISC_LOG_INFO, "rpz: %s: reload done: %s", dname,
isc_result_totext(rpz->updateresult));
dns_rpz_unref_rpzs(rpz->rpzs);
dns_rpz_zones_unref(rpz->rpzs);
}
static isc_result_t
@ -1975,7 +1975,7 @@ dns__rpz_timer_cb(void *arg) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO, "rpz: %s: reload start", domain);
dns_rpz_ref_rpzs(rpz->rpzs);
dns_rpz_zones_ref(rpz->rpzs);
isc_work_enqueue(rpz->loop, update_rpz_cb, update_rpz_done_cb, rpz);
isc_timer_destroy(&rpz->updatetimer);
@ -2026,7 +2026,7 @@ dns__rpz_shutdown(dns_rpz_zone_t *rpz) {
/* Don't wait for timer to trigger for shutdown */
INSIST(rpz->loop != NULL);
dns_rpz_ref_rpzs(rpz->rpzs);
dns_rpz_zones_ref(rpz->rpzs);
isc_async_run(rpz->loop, dns__rpz_timer_stop, rpz);
}
}

View file

@ -271,8 +271,8 @@ destroy(dns_view_t *view) {
dns_rrl_view_destroy(view);
if (view->rpzs != NULL) {
dns_rpz_shutdown_rpzs(view->rpzs);
dns_rpz_detach_rpzs(&view->rpzs);
dns_rpz_zones_shutdown(view->rpzs);
dns_rpz_zones_detach(&view->rpzs);
}
if (view->catzs != NULL) {
dns_catz_zones_shutdown(view->catzs);

View file

@ -1285,7 +1285,7 @@ zone_free(dns_zone_t *zone) {
}
if (zone->rpzs != NULL) {
REQUIRE(zone->rpz_num < zone->rpzs->p.num_zones);
dns_rpz_detach_rpzs(&zone->rpzs);
dns_rpz_zones_detach(&zone->rpzs);
zone->rpz_num = DNS_RPZ_INVALID_NUM;
}
if (zone->catzs != NULL) {
@ -1879,7 +1879,7 @@ dns_zone_rpz_enable(dns_zone_t *zone, dns_rpz_zones_t *rpzs,
REQUIRE(zone->rpzs == rpzs && zone->rpz_num == rpz_num);
} else {
REQUIRE(zone->rpz_num == DNS_RPZ_INVALID_NUM);
dns_rpz_attach_rpzs(rpzs, &zone->rpzs);
dns_rpz_zones_attach(rpzs, &zone->rpzs);
zone->rpz_num = rpz_num;
}
rpzs->defined |= DNS_RPZ_ZBIT(rpz_num);