]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Set the extended DNS error code for RPZ-modified queries
authorAram Sargsyan <aram@isc.org>
Fri, 26 Aug 2022 14:15:16 +0000 (14:15 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 31 Aug 2022 08:56:03 +0000 (08:56 +0000)
When enabled through a configuration option, set the configured EDE code
for the modified queries.

lib/ns/query.c

index c16cac61a223c4da483e44943105300b74088d38..d1c969ca161a75b768e588259f3e09790860c6ff 100644 (file)
@@ -16,6 +16,7 @@
 #include <ctype.h>
 #include <inttypes.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <string.h>
 
 #include <isc/hex.h>
@@ -7267,6 +7268,12 @@ query_checkrpz(query_ctx_t *qctx, isc_result_t result) {
                        UNREACHABLE();
                }
 
+               if (qctx->rpz_st->m.rpz->ede != 0 &&
+                   qctx->rpz_st->m.rpz->ede != UINT16_MAX) {
+                       ns_client_extendederror(qctx->client,
+                                               qctx->rpz_st->m.rpz->ede, NULL);
+               }
+
                /*
                 * Turn off DNSSEC because the results of a
                 * response policy zone cannot verify.