]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove CHECK_FOR_GLUE_IN_ANSWER
authorColin Vidal <colin@isc.org>
Tue, 30 Sep 2025 08:02:34 +0000 (10:02 +0200)
committerColin Vidal <colin@isc.org>
Tue, 30 Sep 2025 08:05:22 +0000 (10:05 +0200)
Macro CHECK_FOR_GLUE_IN_ANSWER is defined in `lib/dns/resolver.c` only,
documented nowhere and not exposed as build configuration. This is valid
at least for 9.21+, 9.20 and 9.18. Furthermore, it doesn't compile
anymore on 9.21+ with -DCHECK_FOR_GLUE_IN_ANSWER=1.

Considering it is very unlikely that anyone build named with this,
remove the code rather than fixing it.

lib/dns/resolver.c

index db152f3e08974ec50e9dbd9d099d417746611a3c..61ec6191f6689ee028e8084cdbe49d937d7d07b9 100644 (file)
@@ -6460,12 +6460,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)));
 
@@ -6517,18 +6511,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) {
@@ -8907,19 +8889,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 && dns_rdatatype_isaddr(fctx->type)) {
-               (void)dns_rdataset_additionaldata(
-                       rctx->ns_rdataset, rctx->ns_name, check_answer, fctx);
-       }
-#endif /* if CHECK_FOR_GLUE_IN_ANSWER */
        FCTX_ATTR_CLR(fctx, FCTX_ATTR_GLUING);
 
        /*