]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
permanently disable QNAME minimization in a fetch when forwarding
authorEvan Hunt <each@isc.org>
Fri, 10 Jul 2020 20:53:30 +0000 (13:53 -0700)
committerMichał Kępień <michal@isc.org>
Wed, 5 Aug 2020 13:43:52 +0000 (15:43 +0200)
QNAME minimization is normally disabled when forwarding. if, in the
course of processing a fetch, we switch back to normal recursion at
some point, we can't safely start minimizing because we may have
been left in an inconsistent state.

lib/dns/resolver.c

index 21f8d96e0e51746cc5f877ebeee9fe27c1f90f22..df43b0a09a6144502837d936af425edd4320ed53 100644 (file)
@@ -4013,6 +4013,15 @@ fctx_nextaddress(fetchctx_t *fctx) {
                        addrinfo->flags |= FCTX_ADDRINFO_MARK;
                        fctx->find = NULL;
                        fctx->forwarding = true;
+
+                       /*
+                        * QNAME minimization is disabled when
+                        * forwarding, and has to remain disabled if
+                        * we switch back to normal recursion; otherwise
+                        * forwarding could leave us in an inconsistent
+                        * state.
+                        */
+                       fctx->minimized = false;
                        return (addrinfo);
                }
        }