]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Always return address records in additional section for NS queries
authorDiego Fronza <diego@isc.org>
Wed, 30 Sep 2020 20:22:39 +0000 (17:22 -0300)
committerDiego Fronza <diego@isc.org>
Wed, 21 Oct 2020 15:12:22 +0000 (12:12 -0300)
lib/ns/query.c

index 207ad9ddccfc033372505a2e8ad7a439b536829f..8f2b78129f5fe56eeb6a4016c58308246878a020 100644 (file)
@@ -1679,7 +1679,9 @@ query_additional_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
         * If we want only minimal responses and are here, then it must
         * be for glue.
         */
-       if (qctx->view->minimalresponses == dns_minimal_yes) {
+       if (qctx->view->minimalresponses == dns_minimal_yes &&
+           client->query.qtype != dns_rdatatype_ns)
+       {
                goto try_glue;
        }
 
@@ -11280,6 +11282,12 @@ ns_query_start(ns_client_t *client, isc_nmhandle_t *handle) {
        {
                client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY |
                                             NS_QUERYATTR_NOADDITIONAL);
+       } else if (qtype == dns_rdatatype_ns) {
+               /*
+                * Always turn on additional records for NS queries.
+                */
+               client->query.attributes &= ~(NS_QUERYATTR_NOAUTHORITY |
+                                             NS_QUERYATTR_NOADDITIONAL);
        }
 
        /*