]> git.ipfire.org Git - thirdparty/bind9.git/commit
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)
commitcdf1b61c27d64d3cbbf68fb271c2e861fa4d705b
tree144c4dddd761c65b95ad562bb3b2deee352d752a
parentcb0a00c83774abe6dfd7845f7d1b5140c3daf0e9
parent5033b9e51c8c8fa24b0378c4f8a3e16eade384bc
chg: dev: Follow-up of disambiguate `query_cname()` and `query_dname()` usage

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