]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
In rctx_answer return DNS_R_DELEGATION on NOFOLLOW
authorMark Andrews <marka@isc.org>
Fri, 19 May 2023 02:22:51 +0000 (12:22 +1000)
committerMark Andrews <marka@isc.org>
Wed, 28 Jun 2023 01:48:32 +0000 (11:48 +1000)
When DNS_FETCHOPT_NOFOLLOW is set DNS_R_DELEGATION needs to be
returned to restart the resolution process rather than converting
it to ISC_R_SUCCESS.

lib/dns/resolver.c

index d2981413001270c9162a0a4bdb2cddf1d3447cad..afad02d005867aeebff65254ab8056757e8f5689 100644 (file)
@@ -7615,7 +7615,8 @@ resquery_response(isc_result_t eresult, isc_region_t *region, void *arg) {
                        break;
                case DNS_R_DELEGATION:
                        /*
-                        * With NOFOLLOW we want to pass the result code.
+                        * With NOFOLLOW we want to pass return
+                        * DNS_R_DELEGATION to resume_qmin.
                         */
                        if ((fctx->options & DNS_FETCHOPT_NOFOLLOW) == 0) {
                                result = ISC_R_SUCCESS;
@@ -8156,6 +8157,14 @@ rctx_answer(respctx_t *rctx) {
                }
 
                if (result == DNS_R_DELEGATION) {
+                       /*
+                        * With NOFOLLOW we want to return DNS_R_DELEGATION to
+                        * resume_qmin.
+                        */
+                       if ((rctx->fctx->options & DNS_FETCHOPT_NOFOLLOW) != 0)
+                       {
+                               return (result);
+                       }
                        result = ISC_R_SUCCESS;
                } else {
                        /*
@@ -8197,7 +8206,7 @@ rctx_answer_positive(respctx_t *rctx) {
        isc_result_t result;
        fetchctx_t *fctx = rctx->fctx;
 
-       FCTXTRACE("rctx_answer");
+       FCTXTRACE("rctx_answer_positive");
 
        rctx_answer_init(rctx);
        rctx_answer_scan(rctx);