]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove the disabled CHECK_FOR_GLUE_IN_ANSWER code
authorOndřej Surý <ondrej@isc.org>
Wed, 6 May 2026 12:30:01 +0000 (14:30 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 12 May 2026 14:18:16 +0000 (16:18 +0200)
The CHECK_FOR_GLUE_IN_ANSWER macro defaulted to 0 and was never enabled
by the build system, leaving check_answer() and the answer-section glue
scan in rctx_referral() as dead code.  Drop them so the surrounding
referral-cache path is easier to reason about.

lib/dns/resolver.c

index 6bab8057fb4bac98b42c2285f05f852b0239f080..3c0fea208c43eca4e3196a9f9353a297261721f4 100644 (file)
@@ -6901,12 +6901,6 @@ check_section(void *arg, const dns_name_t *addname, dns_rdatatype_t type,
 
        REQUIRE(VALID_FCTX(fctx));
 
-#if CHECK_FOR_GLUE_IN_ANSWER
-       if (section == DNS_SECTION_ANSWER && type != dns_rdatatype_a) {
-               return ISC_R_SUCCESS;
-       }
-#endif /* if CHECK_FOR_GLUE_IN_ANSWER */
-
        gluing = (GLUING(fctx) || (fctx->type == dns_rdatatype_ns &&
                                   dns_name_equal(fctx->name, dns_rootname)));
 
@@ -6962,18 +6956,6 @@ check_related(void *arg, const dns_name_t *addname, dns_rdatatype_t type,
        return check_section(arg, addname, type, found, DNS_SECTION_ADDITIONAL);
 }
 
-#ifndef CHECK_FOR_GLUE_IN_ANSWER
-#define CHECK_FOR_GLUE_IN_ANSWER 0
-#endif /* ifndef CHECK_FOR_GLUE_IN_ANSWER */
-
-#if CHECK_FOR_GLUE_IN_ANSWER
-static isc_result_t
-check_answer(void *arg, const dns_name_t *addname, dns_rdatatype_t type,
-            dns_rdataset_t *found) {
-       return check_section(arg, addname, type, found, DNS_SECTION_ANSWER);
-}
-#endif /* if CHECK_FOR_GLUE_IN_ANSWER */
-
 static bool
 is_answeraddress_allowed(dns_view_t *view, dns_name_t *name,
                         dns_rdataset_t *rdataset) {
@@ -9518,22 +9500,6 @@ rctx_referral(respctx_t *rctx) {
         */
        (void)dns_rdataset_additionaldata(rctx->ns_rdataset, rctx->ns_name,
                                          check_related, rctx, 0);
-#if CHECK_FOR_GLUE_IN_ANSWER
-       /*
-        * Look in the answer section for "glue" that is incorrectly
-        * returned as a answer.  This is needed if the server also
-        * minimizes the response size by not adding records to the
-        * additional section that are in the answer section or if
-        * the record gets dropped due to message size constraints.
-        */
-       if (rctx->glue_in_answer &&
-           (fctx->type == dns_rdatatype_aaaa || fctx->type == dns_rdatatype_a))
-       {
-               (void)dns_rdataset_additionaldata(rctx->ns_rdataset,
-                                                 rctx->ns_name, check_answer,
-                                                 fctx, 0);
-       }
-#endif /* if CHECK_FOR_GLUE_IN_ANSWER */
        FCTX_ATTR_CLR(fctx, FCTX_ATTR_GLUING);
 
        /*