From f1def9162599df86bb29cecc200ebfea44755426 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 6 Mar 2018 10:48:21 +1100 Subject: [PATCH] check insist on every call; make conditional block constistent with rest of code --- lib/ns/query.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ns/query.c b/lib/ns/query.c index 3aee26861b..7cea53515d 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -3878,6 +3878,10 @@ rpz_rewrite(ns_client_t *client, dns_rdatatype_t qtype, rpz_ver = rpzs->rpz_ver; RWUNLOCK(&rpzs->search_lock, isc_rwlocktype_read); +#ifndef USE_DNSRPS + INSIST(!popt.dnsrps_enabled); +#endif + if (st == NULL) { st = isc_mem_get(client->mctx, sizeof(*st)); if (st == NULL) @@ -3903,8 +3907,8 @@ rpz_rewrite(ns_client_t *client, dns_rdatatype_t qtype, st->popt = popt; st->rpz_ver = rpz_ver; client->query.rpz_st = st; - if (popt.dnsrps_enabled) { #ifdef USE_DNSRPS + if (popt.dnsrps_enabled) { if (st->rpsdb != NULL) { dns_db_detach(&st->rpsdb); } @@ -3919,10 +3923,8 @@ rpz_rewrite(ns_client_t *client, dns_rdatatype_t qtype, st->m.policy = DNS_RPZ_POLICY_ERROR; return (ISC_R_SUCCESS); } -#else - INSIST(0); -#endif } +#endif } /* -- GitLab