]> 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:44:18 +0000 (15:44 +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 a661ab728398fc24cb559eb04eca768ef9c79823..8956baee8124f1337f82654adda4d12e0e9acaff 100644 (file)
@@ -4023,6 +4023,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);
                }
        }