]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
chg: dev: Follow-up of disambiguate `query_cname()` and `query_dname()` usage
authorColin Vidal <colin@isc.org>
Wed, 1 Jul 2026 09:56:41 +0000 (11:56 +0200)
committerMichał Kępień <michal@isc.org>
Fri, 10 Jul 2026 07:26:46 +0000 (09:26 +0200)
Previous commit "Disambiguate `query_cname()` and `query_dname()` usage"
was harmless but also useless, as it was checking `qctx->result` which
is always set to `ISC_R_SUCCESS` when `qctx` is initialized. The intent
was to check `qctx->fresp->result` (which is the result provided by the
resolver). But this was also wrong (this is actually the case we do
expect `query_cname()`/`query_dname()` to be called, to follow the
chain).

The actual invarant that needs to be checked is if the qtype is CNAME
then we do not follow the chain, so we can't call `query_cname()`. This
invariant has been added.

If the qtype is DNAME, it's more complex, because a DNAME can be found
from a local zone or cache and the chain can be locally followed. In
which case, calling `query_dname()` is legit, as soon as the qname is a
subname of the DNAME target. This invariant is already checked.

Merge branch 'colin/follow-up-disambiguate-query_cname_dname' into 'security-main'

See merge request isc-private/bind9!1089


Trivial merge