]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check insist on every call; make conditional block constistent with rest of code
authorMark Andrews <marka@isc.org>
Mon, 5 Mar 2018 23:48:21 +0000 (10:48 +1100)
committerEvan Hunt <each@isc.org>
Wed, 7 Mar 2018 20:18:16 +0000 (15:18 -0500)
lib/ns/query.c

index 3aee26861b08e33751519ebefbca5c2a5b858b96..7cea53515d5a8c513ce2079aa7413cf0432e22df 100644 (file)
@@ -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
        }
 
        /*