]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
15 months agofix: test: Fix 'ans' servers so they respond with consistent answers to NS queries... 218080
Mark Andrews [Tue, 4 Feb 2025 02:35:33 +0000 (02:35 +0000)] 
fix: test: Fix 'ans' servers so they respond with consistent answers to NS queries at QNAME.

The ANS servers were not to written to handle NS queries at the QNAME, resulting in gratuitous protocol errors that will break tests when NS requests are made for the QNAME: i.e., NXDOMAIN for NS vs data for expected type,  CNAME not being returned for all query types.

Prerequisite for !9155

Closes #5062

Merge branch '5062-fix-ans-servers-ns-at-qname' into 'main'

See merge request isc-projects/bind9!9786

15 months agoFix gratuitious DNS protocol errors in the ANS servers
Mark Andrews [Thu, 18 Jul 2024 03:35:41 +0000 (13:35 +1000)] 
Fix gratuitious DNS protocol errors in the ANS servers

The ANS servers were not to written to handle NS queries at the
QNAME resulting in gratuitious protocol errors that will break tests
when NS requests are made for the QNAME.

15 months agonew: usr: Print the expiration time of the stale records
Ondřej Surý [Mon, 3 Feb 2025 15:18:31 +0000 (15:18 +0000)] 
new: usr: Print the expiration time of the stale records

Print the expiration time of the stale RRsets in the cache dump.

Merge branch 'ondrej/print-expiration-time-of-stale-records' into 'main'

See merge request isc-projects/bind9!10057

15 months agoPrint the expiration time of the stale records (not ancient)
Ondřej Surý [Mon, 3 Feb 2025 10:15:15 +0000 (11:15 +0100)] 
Print the expiration time of the stale records (not ancient)

In #1870, the expiration time of ANCIENT records were printed, but
actually the ancient records are very short lived, and the information
carries a little value.

Instead of printing the expiration of ANCIENT records, print the
expiration time of STALE records.

15 months agofix: usr: Recently expired records could be returned with timestamp in future
Ondřej Surý [Mon, 3 Feb 2025 13:39:39 +0000 (13:39 +0000)] 
fix: usr: Recently expired records could be returned with timestamp in future

Under rare circumstances, the RRSet that expired at the time of
the query could be returned with TTL far in the future.  This
has been fixed.

As a side-effect, the expiration time of expired RRSets are no
longer printed out in the cache dump.

Closes #5094

Merge branch '5094-fix-timestamp-in-ttl' into 'main'

See merge request isc-projects/bind9!10048

15 months agoRestore the .ttl field for slabheader in dns_qpzone
Ondřej Surý [Mon, 3 Feb 2025 13:06:37 +0000 (14:06 +0100)] 
Restore the .ttl field for slabheader in dns_qpzone

The original .ttl field was actually used as TTL in the dns_qpzone unit.
Restore the field by adding it to union with the .expire struct member
and cleanup all the code that added or subtracted 'now' from the ttl
field as that was misleading as 'now' would be always 0 for qpzone
database.

15 months agoRemove duplicate 'now' argument from find_coveringnsec()
Ondřej Surý [Sun, 2 Feb 2025 13:07:18 +0000 (14:07 +0100)] 
Remove duplicate 'now' argument from find_coveringnsec()

The find_coveringnsec() was getting the 'now' from two sources -
search->now and separate now argument.  Things like this are ticking
bombs, remove the extra 'now' argument and use single source of 'now'.

15 months agoExpand the usage of mark_ancient() helper functions
Ondřej Surý [Sun, 2 Feb 2025 12:56:37 +0000 (13:56 +0100)] 
Expand the usage of mark_ancient() helper functions

When the mark_ancient() helper function was introduced, couple of places
with duplicate (or almost duplicate) code was missed.  Move the
mark_ancient() function closer to the top of the file, and correctly use
it in places that mark the header as ANCIENT.

15 months agoAdd better ZEROTTL handling in bindrdataset()
Ondřej Surý [Sun, 2 Feb 2025 12:38:04 +0000 (13:38 +0100)] 
Add better ZEROTTL handling in bindrdataset()

If we know that the header has ZEROTTL set, the server should never send
stale records for it and the TTL should never be anything else than 0.
The comment was already there, but the code was not matching the
comment.

15 months agoIn dns_slabheader_t structure, change .ttl to .expire
Ondřej Surý [Sun, 2 Feb 2025 12:31:36 +0000 (13:31 +0100)] 
In dns_slabheader_t structure, change .ttl to .expire

The old name was misleading as it never meant time-to-live, e.g. number
of seconds from now when the header should expire.  The true meaning was
an expiration time e.g. now + ttl.  This was the original design bug
that caused the slip when we assigned header->ttl to rdataset->ttl.
Because the name was matching, nobody has questioned the correctness of
the code both during the MR review and during the numerous re-reviews
when we were searching for the cause of the 54 year TTL.

15 months agoIn cache, set rdataset TTL to 0 when the header is not active
Ondřej Surý [Sun, 2 Feb 2025 10:44:00 +0000 (11:44 +0100)] 
In cache, set rdataset TTL to 0 when the header is not active

When the header has been marked as ANCIENT, but the ttl hasn't been
reset (this happens in couple of places), the rdataset TTL would be
set to the header timestamp instead to a reasonable TTL value.

Since this header has been already expired (ANCIENT is set), set the
rdataset TTL to 0 and don't reuse this field to print the expiration
time when dumping the cache.  Instead of printing the time, we now
just print 'expired (awaiting cleanup'.

15 months agofix: usr: validate adb fetches
Mark Andrews [Mon, 3 Feb 2025 02:18:09 +0000 (02:18 +0000)] 
fix: usr: validate adb fetches

ADB responses were not being validated, allowing spoofed responses to be accepted and used for further lookups. This should not be possible when the servers for the zone are in a signed zone, except with CD=1 requests or when glue is needed. This has been fixed.

Closes #5066

Merge branch '5066-validate-adb-fetches' into 'main'

See merge request isc-projects/bind9!10052

15 months agoCheck recovery from spoofed server addresses
Mark Andrews [Wed, 22 Jan 2025 12:54:53 +0000 (23:54 +1100)] 
Check recovery from spoofed server addresses

Named was failing to recover when spoofed nameserver address from
a signed zone for a peer zone were returned to a previous CD=1
query. Validate non-glue interior server addresses before using them.

15 months agoSet PENDINGOK if STARTATZONE is set
Mark Andrews [Wed, 22 Jan 2025 09:58:33 +0000 (20:58 +1100)] 
Set PENDINGOK if STARTATZONE is set

When there are parent and child zones on the same server, the DNSKEY
lookup was failing as the pending record we are validating is needed
to fetch the DNSKEY records.  This change allows that to happen.
The caller is already setting STARTATZONE when the name being looked
up is a subdomain of the current domain.

15 months agoValidate address lookups from ADB
Mark Andrews [Fri, 17 Jan 2025 08:32:28 +0000 (19:32 +1100)] 
Validate address lookups from ADB

The address lookups from ADB were not being validated, allowing
spoofed responses to be accepted and used for other lookups.

Validate the answers except when CD=1 is set in the triggering
request.  Separate ADB names looked up with CD=1 from those without
CD=1, to prevent the use of unvalidated answers in the normal lookup
case (CD=0).  Set the TTL on unvalidated (pending) responses to
ADB_CACHE_MINIMUM when adding them to the ADB.

15 months agofix: dev: Fix the cache findzonecut() implementation
Ondřej Surý [Sun, 2 Feb 2025 18:54:24 +0000 (18:54 +0000)] 
fix: dev: Fix the cache findzonecut() implementation

The search for the deepest known zone cut in the cache could improperly reject a node if it contained any stale data, regardless of whether it was the NS RRset that was stale.

Closes #5155

Merge branch '5155-fix-findzonecut' into 'main'

See merge request isc-projects/bind9!10047

15 months agofix the cache findzonecut implementation
Evan Hunt [Sat, 1 Feb 2025 21:09:22 +0000 (13:09 -0800)] 
fix the cache findzonecut implementation

the search for the deepest known zone cut in the cache could
improperly reject a node containing stale data, even if the
NS rdataset wasn't the data that was stale.

this change also improves the efficiency of the search by
stopping it when both NS and RRSIG(NS) have been found.

16 months agofix: ci: Fix shell escaping in post-merge before_script
Petr Špaček [Fri, 31 Jan 2025 13:34:59 +0000 (13:34 +0000)] 
fix: ci: Fix shell escaping in post-merge before_script

Merge branch 'pspacek/no-cross-project-after-merge-jobs-fix' into 'main'

See merge request isc-projects/bind9!10042

16 months agoFix shell escaping in post-merge before_script
Petr Špaček [Fri, 31 Jan 2025 13:20:04 +0000 (14:20 +0100)] 
Fix shell escaping in post-merge before_script

Fixup for commit 60140607740bf8e07c0f223c18798bef36ef439c
"Do not trigger post-merge jobs for cross-project pushes".

Related: isc-projects/bind9!10029

16 months agofix: ci: Do not trigger post-merge jobs for cross-project pushes
Petr Špaček [Fri, 31 Jan 2025 12:10:41 +0000 (12:10 +0000)] 
fix: ci: Do not trigger post-merge jobs for cross-project pushes

Merge branch 'pspacek/no-cross-project-after-merge-jobs' into 'main'

See merge request isc-projects/bind9!10029

16 months agoDo not trigger post-merge jobs for cross-project pushes
Petr Špaček [Thu, 30 Jan 2025 10:24:59 +0000 (11:24 +0100)] 
Do not trigger post-merge jobs for cross-project pushes

We need to avoid double-triggering of post-merge jobs in the following
scenario:

 1. A private MR gets merged into the private BIND 9 repository.

 2. This merge operation triggers a "push" pipeline in the private
    repository, which correctly runs post-merge jobs, e.g. to set MR
    metadata in the private project.

 3. When a release is published, a script is run to change the
    automatically assigned milestone value ("Not released yet") to
    something else.

 4. Shortly afterwards, the result of the merge from step 1 is merged
    back into a maintenance branch in the public repository.

 5. The push operation triggers another "push" pipeline, this time in
    the public project.

At this point there are two problems:

  - If the script is dumb (like it currently is), it will extract the
    merge request ID from the merge commit description and change the
    milestone for a merge request in the wrong project namespace.

  - Even if the script was fixed to extract and use the correct GitLab
    project reference, it would reset the milestone for the merge
    request in the private repository back to "Not released yet" - while
    the milestone set in step 3 should be retained.

An alternative would be to change the order of operations so that
post-release milestoning happens at a later stage, while also fixing the
script to correctly follow cross-project references, but that approach
seems more fragile than simply failing on all cross-project pushes.  The
rule to enforce is: each project should only take care of its own
post-merge tasks.

16 months agochg: nil: Update CVE checklist
Michał Kępień [Fri, 31 Jan 2025 11:27:51 +0000 (11:27 +0000)] 
chg: nil: Update CVE checklist

This MR adds an extra CVE checklist step suggested by @pspacek after
CVE-2024-0760.  See [Mattermost][1] for context.

It also syncs checklist steps with their corresponding links to the
explanations wiki page as these have been out-of-sync since !9307.

[1]: https://mattermost.isc.org/isc/pl/156npi4bwtr6pechbj6sfs6jjo

Merge branch 'michal/update-cve-checklist' into 'main'

See merge request isc-projects/bind9!9949

16 months agoSync checklist steps with links to explanations
Michał Kępień [Fri, 31 Jan 2025 11:26:10 +0000 (12:26 +0100)] 
Sync checklist steps with links to explanations

16 months agoUpdate CVE checklist
Michał Kępień [Fri, 31 Jan 2025 11:26:10 +0000 (12:26 +0100)] 
Update CVE checklist

16 months agochg: ci: Use default cloning depth for the Danger CI job
Michał Kępień [Fri, 31 Jan 2025 09:26:25 +0000 (09:26 +0000)] 
chg: ci: Use default cloning depth for the Danger CI job

With shallow fetching working reliably in pygit2 1.17.0+, there is no
longer any need for GitLab CI runners to clone the BIND 9 repository
with a fixed depth of 1000 during every "danger" CI job as Hazard is now
able to fetch remote refs with an arbitrary depth, controlled by the
HAZARD_FETCH_DEPTH environment variable.  The latter can be defined via
GitLab project's CI settings and adjusted as needed over time, without
the need to update .gitlab-ci.yml every time its value needs to be
changed.

Merge branch 'michal/use-default-cloning-depth-for-the-danger-ci-job' into 'main'

See merge request isc-projects/bind9!9946

16 months agoUse default cloning depth for the Danger CI job
Michał Kępień [Fri, 31 Jan 2025 09:25:56 +0000 (10:25 +0100)] 
Use default cloning depth for the Danger CI job

With shallow fetching working reliably in pygit2 1.17.0+, there is no
longer any need for GitLab CI runners to clone the BIND 9 repository
with a fixed depth of 1000 during every "danger" CI job as Hazard is now
able to fetch remote refs with an arbitrary depth, controlled by the
HAZARD_FETCH_DEPTH environment variable.  The latter can be defined via
GitLab project's CI settings and adjusted as needed over time, without
the need to update .gitlab-ci.yml every time its value needs to be
changed.

16 months agochg: dev: Refactor decref() in both QPDB
Evan Hunt [Fri, 31 Jan 2025 04:45:07 +0000 (04:45 +0000)] 
chg: dev: Refactor decref() in both QPDB

Clean up the pattern in the newref() and decref() functions in QP databases.  Replace the `db_nodelock_t` structure with plain reference counting for every active database node in QPDB.

Related to #5134

Merge branch '5134-refactor-decref-functions-in-qpdb' into 'main'

See merge request isc-projects/bind9!10006

16 months agoClarify reference counting in QP databases
Evan Hunt [Thu, 30 Jan 2025 22:42:57 +0000 (14:42 -0800)] 
Clarify reference counting in QP databases

Change the names of the node reference counting functions
and add comments to make the mechanism easier to understand:

- newref() and decref() are now called qpcnode_acquire()/
  qpznode_acquire() and qpcnode_release()/qpznode_release()
  respectively; this reflects the fact that they modify both
  the internal and external reference counters for a node.

- qpcnode_newref() and qpznode_newref() are now called
  qpcnode_erefs_increment() and qpznode_erefs_increment(), and
  qpcnode_decref() and qpznode_decref() are now called
  qpcnode_erefs_decrement() and qpznode_erefs_decrement(),
  to reflect that they only increase and decrease the node's
  external reference counters, not internal.

16 months agoRemove db_nodelock_t in favor of reference counted qpdb
Ondřej Surý [Mon, 27 Jan 2025 20:07:11 +0000 (21:07 +0100)] 
Remove db_nodelock_t in favor of reference counted qpdb

This removes the db_nodelock_t structure and changes the node_locks
array to be composed only of isc_rwlock_t pointers.  The .reference
member has been moved to qpdb->references in addition to
common.references that's external to dns_db API users.  The .exiting
members has been completely removed as it has no use when the reference
counting is used correctly.

16 months agoRemove origin_node from qpcache
Ondřej Surý [Mon, 27 Jan 2025 17:13:38 +0000 (18:13 +0100)] 
Remove origin_node from qpcache

The origin_node in qpcache was always NULL, so we can remove the
getoriginode() function and origin_node pointer as the
dns_db_getoriginnode() correctly returns ISC_R_NOTFOUND when the
function is not implemented.

16 months agoRefactor decref() in both qpcache.c and qpzone.c
Ondřej Surý [Mon, 27 Jan 2025 17:06:17 +0000 (18:06 +0100)] 
Refactor decref() in both qpcache.c and qpzone.c

Cleanup the pattern in the decref() functions in both qpcache.c and
qpzone.c, so it follows the similar patter as we already have in
newref() function.

16 months agofix: dev: DNSSEC EDE system tests on FIPS platform
Colin Vidal [Thu, 30 Jan 2025 13:07:18 +0000 (13:07 +0000)] 
fix: dev: DNSSEC EDE system tests on FIPS platform

Changes introducing the support of extended DNS error code 1 and 2 uses
SHA-1 digest for some tests which break FIPS platform. The digest itself
was irrelevant, another digest is used.

Merge branch 'colin/fix-fips-9807' into 'main'

See merge request isc-projects/bind9!10002

16 months agofix DNSSEC EDE system tests on FIPS platform
Colin Vidal [Mon, 27 Jan 2025 11:52:19 +0000 (12:52 +0100)] 
fix DNSSEC EDE system tests on FIPS platform

Changes !9948 introducing the support of extended DNS error code 1 and 2
uses SHA-1 digest for some tests which break FIPS platform. The digest
itself was irrelevant, another digest is used.

16 months agofix: dev: Split and simplify the use of EDE list implementation
Ondřej Surý [Thu, 30 Jan 2025 11:29:53 +0000 (11:29 +0000)] 
fix: dev: Split and simplify the use of EDE list implementation

Instead of mixing the dns_resolver and dns_validator units directly with
the EDE code, split-out the dns_ede functionality into own separate
compilation unit and hide the implementation details behind abstraction.

Additionally, the new dns_edelist_t doesn't have to be copied into all
responses as those are attached to the fetch context, but it could be
only passed by reference.

This makes the dns_ede implementation simpler to use, although sligtly
more complicated on the inside.

Closes #5141

Merge branch '5141-ede-mem-fix-v2' into 'main'

See merge request isc-projects/bind9!10016

16 months agoUse DNS_EDE_OTHER instead of its literal value
Colin Vidal [Thu, 30 Jan 2025 10:54:36 +0000 (11:54 +0100)] 
Use DNS_EDE_OTHER instead of its literal value

16 months agoupdate EDE copy and add dup tests
Colin Vidal [Wed, 29 Jan 2025 22:30:07 +0000 (23:30 +0100)] 
update EDE copy and add dup tests

Update EDE tests to exercise the bitmap and next ede index logic

16 months agodetect dup EDE with bitmap and store next pos
Colin Vidal [Wed, 29 Jan 2025 22:27:34 +0000 (23:27 +0100)] 
detect dup EDE with bitmap and store next pos

In order to avoid to loop to find the next position to store an EDE in
a dns_edectx_t, add a "nextede" state which holds the next available
position.

Also, in order ot avoid to loop to find if an EDE is already existing in
a dns_edectx_t, and avoid a duplicate, use a bitmap to immediately know
if the EDE is there or not.

Those both changes applies for adding or copying EDE.

Also make the direction of dns_ede_copy more explicit/avoid errors by
making "edectx_from" a const pointer.

16 months agoadd lib/dns/ede.c documentation
Colin Vidal [Wed, 29 Jan 2025 21:32:33 +0000 (22:32 +0100)] 
add lib/dns/ede.c documentation

Add documentation usage of EDE compilation unit as well as centralize
all EDE-related macros in the same lib/dns/include/dns/ede.h header.

16 months agoRefactor test covering dns_ede API
Colin Vidal [Wed, 29 Jan 2025 17:34:51 +0000 (18:34 +0100)] 
Refactor test covering dns_ede API

Migrate tests cases in client_test code which were exclusively testing
code which is now all wrapped inside ede compilation unit. Those are
testing maximum number of EDE, duplicate EDE as well as truncation of
text of an EDE.

Also add coverage for the copy of EDE from an edectx to another one, as
well as checking the assertion of the maximum EDE info code which can be
used.

16 months agoSplit and simplify the use of EDE list implementation
Ondřej Surý [Wed, 29 Jan 2025 10:11:32 +0000 (11:11 +0100)] 
Split and simplify the use of EDE list implementation

Instead of mixing the dns_resolver and dns_validator units directly with
the EDE code, split-out the dns_ede functionality into own separate
compilation unit and hide the implementation details behind abstraction.

Additionally, the EDE codes are directly copied into the ns_client
buffers by passing the EDE context to dns_resolver_createfetch().

This makes the dns_ede implementation simpler to use, although sligtly
more complicated on the inside.

Co-authored-by: Colin Vidal <colin@isc.org>
Co-authored-by: Ondřej Surý <ondrej@isc.org>
16 months agofix: ci: remove allow failure in cross version config tests
Andoni Duarte [Thu, 30 Jan 2025 10:02:18 +0000 (10:02 +0000)] 
fix: ci: remove allow failure in cross version config tests

From https://gitlab.isc.org/isc-projects/bind9/-/issues/5087, the relevant MRs have been merged in the January 2025 release. Hence this MR removes `allow_failure: true` in CI.

Merge branch 'andoni/remove-allow-failure-in-cross-version-config-tests' into 'main'

See merge request isc-projects/bind9!10026

16 months agoUpdate cross-version-config-tests CI
Andoni Duarte Pintado [Thu, 30 Jan 2025 09:24:48 +0000 (10:24 +0100)] 
Update cross-version-config-tests CI

Remove `allow_failure: true` from .gitlab-ci.yaml, as the relevant
MRs have been merged in the January 2025 release.

16 months agoMerge tag 'v9.21.4'
Andoni Duarte Pintado [Wed, 29 Jan 2025 16:17:18 +0000 (17:17 +0100)] 
Merge tag 'v9.21.4'

16 months agochg: ci: Use make clean to reduce artifacts in successful jobs
Nicki Křížek [Wed, 29 Jan 2025 14:11:13 +0000 (14:11 +0000)] 
chg: ci: Use make clean to reduce artifacts in successful jobs

Reduce the amount of artifacts stored by running make clean at the end
of unit and system test run. If any of the previous commands fail, the
runner will stop executing the commands in `script` immediately, so the
cleanup only happens if none of the previous commands failed.

The build artifacts from unit and system tests are re-used anywhere and
should be safe to throw away immediately.

Merge branch 'nicki/reduce-ci-artifacts' into 'main'

See merge request isc-projects/bind9!10015

16 months agoEnable unit test artifacts for gcov jobs
Nicki Křížek [Tue, 28 Jan 2025 15:59:47 +0000 (16:59 +0100)] 
Enable unit test artifacts for gcov jobs

Without using the build artifacts from the unit test jobs in the
bookworm tests, the gcov would be incomplete.

16 months agoUse make clean to reduce artifacts in successful jobs
Nicki Křížek [Tue, 28 Jan 2025 14:23:01 +0000 (15:23 +0100)] 
Use make clean to reduce artifacts in successful jobs

Reduce the amount of artifacts stored by running make clean at the end
of unit and system test run. If any of the previous commands fail, the
runner will stop executing the commands in `script` immediately, so the
cleanup only happens if none of the previous commands failed.

The build artifacts from unit and system tests are re-used anywhere and
should be safe to throw away immediately. Same for respdiff.

16 months agofix: ci: Run merged-metadata job for release branches in private repo
Nicki Křížek [Tue, 28 Jan 2025 13:35:07 +0000 (13:35 +0000)] 
fix: ci: Run merged-metadata job for release branches in private repo

The prior regex didn't match the actual names we use for release
branches in the private repo. This caused the merged-metadata job to not
be created upon merging to a release branch, resulting in the private MR
not being properly milestoned.

Use the correct regex along with protecting the v9.*-release branches in
the gitlab UI so that they have access to the token used to perform the
required API operations.

Merge branch 'nicki/ci-fix-post-merge-in-private-repo' into 'main'

See merge request isc-projects/bind9!10003

16 months agoRun merged-metadata job for release branches in private repo
Nicki Křížek [Mon, 27 Jan 2025 14:30:39 +0000 (15:30 +0100)] 
Run merged-metadata job for release branches in private repo

The prior regex didn't match the actual names we use for release
branches in the private repo. This caused the merged-metadata job to not
be created upon merging to a release branch, resulting in the private MR
not being properly milestoned.

Use the correct regex along with protecting the v9.*-release branches in
the gitlab UI so that they have access to the token used to perform the
required API operations.

16 months agofix: doc: Use archived version of draft-icann-dnssec-keymgmt-01.txt
Michal Nowak [Tue, 28 Jan 2025 11:55:42 +0000 (11:55 +0000)] 
fix: doc: Use archived version of draft-icann-dnssec-keymgmt-01.txt

The iana.org link is gone.

Merge branch 'mnowak/linkcheck-fix-draft-icann-dnssec-keymgmt-01.txt-link' into 'main'

See merge request isc-projects/bind9!10010

16 months agoUse archived version of draft-icann-dnssec-keymgmt-01.txt
Michal Nowak [Tue, 28 Jan 2025 11:13:57 +0000 (12:13 +0100)] 
Use archived version of draft-icann-dnssec-keymgmt-01.txt

The iana.org link is gone.

16 months agochg: test: Add stress tests with DoH and DoT
Michal Nowak [Mon, 27 Jan 2025 20:09:49 +0000 (20:09 +0000)] 
chg: test: Add stress tests with DoH and DoT

Validation pipeline: https://gitlab.isc.org/isc-projects/bind9/-/pipelines/160984

Prerequisites:
- [x] isc-private/devops!11
- [x] https://gitlab.isc.org/isc-projects/bind9-qa/-/merge_requests/9

Things to consider:
- FreeBSD DoH jobs are not added because Flamethrower queries always timeout.
- This adds 15 more CI jobs:
  - Linux (AWS autoscaler): `(auth + recursive + RPZ) * (DoH + DoT) * (amd64 + arm64) = 12`
  - FreeBSD (one FreeBSD runner): `(auth + recursive + RPZ) * (DoT) * (amd64) = 3`
- Autoscaler is not yet present on FreeBSD. Adding 3 CI jobs (i.e., DoT) run serially adds 3 hours to the pipeline runtime. Should we add just one FreeBSD DoT job to limit the runtime?
- DoH/DoT performance is slightly lower than pure TCP, so the threshold for the test to pass must be lowered by 5-10% (see isc-private/bind-qa!40).

Merge branch 'mnowak/stress-test-with-doh-dot' into 'main'

See merge request isc-projects/bind9!5800

16 months agoAdd DoH and DoT stress tests, generate test configurations
Michal Nowak [Mon, 19 Feb 2024 14:55:00 +0000 (15:55 +0100)] 
Add DoH and DoT stress tests, generate test configurations

Add DoH and DoT stress test jobs. The DoH scenario on FreeBSD is omitted
because all Flamethrower's DoH queries timeout on this platform.

Since the response rate of DoT queries is lower than that of DoH and
TCP, the expected TCP response rate is 80%.

Due to the large number of similar stress test configurations, the
"util/generate-stress-test-configs.py" script now generates them as part
of a downstream pipeline. The script is expected to be run exclusively
within the CI environment, which sources all environmental variables and
files.

This refactoring brought the following changes:

- To start a stress test immediately and not wait for artifacts of the
  autoreconf job, run the "autoreconf -fi" command as part of every job.

- Drop the BIND_STRESS_TEST_* variables as they were rarely used and
  conflicted with mode and platform selection in the configuration
  generator.

- Most pipelines now include a few short, randomly selected stress test
  jobs. To schedule all stress tests, set the ALL_BIND_STRESS_TESTS
  environmental variable, push a tag to CI, or run a scheduled pipeline.

- Set the BIND_STRESS_TESTS_RUN_TIME environmental variable to pick the
  stress test runtime of your choosing, set the BIND_STRESS_TESTS_RATE
  environmental variable to set different than the default query rate.

- Job timeout is set to 30 minutes plus stress test runtime in minutes.

16 months agofix: dev: fix EDE 22 time out detection
Colin Vidal [Mon, 27 Jan 2025 11:48:49 +0000 (11:48 +0000)] 
fix: dev: fix EDE 22 time out detection

Extended DNS error 22 (No reachable authority) was previously detected when `fctx_expired` fired. It turns out this function is used as a "safety net" and the timeout detection should be caught earlier.

It was working though, because of another issue fixed by !9927. But then, the recursive request timed out detection occurs before `fctx_expired` making impossible to raise the EDE 22 error.

This fixes the problem by triggering the EDE 22 in the part of the code detecting the (TCP or UDP) time out and taking the decision to cancel the whole fetch (i.e. There is no other server to attempt to contact).

Note this is not targeting users (no release note) because there is no release versions of BIND between !9927 and this changes. Thus a release note would be confusing.

Closes #5137

Merge branch '5137-ede22' into 'main'

See merge request isc-projects/bind9!9985

16 months agofix byte order in EDE logging
Colin Vidal [Fri, 24 Jan 2025 16:27:09 +0000 (17:27 +0100)] 
fix byte order in EDE logging

When an EDE code is added to a message, the code is converted early in a
big-endian order so it can be memcpy-ed directly in the EDE buffer that
will go on the wire.

This previous change forget to update debug logs which still assume the
EDE code was in host byte order. Add a separate variable to
differentiate both and avoid ambiguities

16 months agoupdate serve-stale test to support EDE 22
Colin Vidal [Fri, 24 Jan 2025 10:23:43 +0000 (11:23 +0100)] 
update serve-stale test to support EDE 22

When EDE 3 (stale answer) was added the serve-stale tests were checking
for those exclusively, i.e. grepping for no "EDE" in the dig output when
no stale answer was expected.

However, some stale tests disable stale answers and make the
authoritative server unresponsive, effectively triggering a timed out
request thus an EDE 22. Update those tests so they still tests the
absence of EDE 3 error, but also the presence of EDE 22.

16 months agoadd new EDE 22 system tests
Colin Vidal [Thu, 23 Jan 2025 15:43:53 +0000 (16:43 +0100)] 
add new EDE 22 system tests

This re-do a previously existing EDE 22 system test as well as add
another one making sure the timed out flow detection works also on UDP
when the resolver is contacting the authoritative server. (the existing
test was using TCP to contact the authoritative servers).

16 months agofix EDE 22 time out detection
Colin Vidal [Thu, 23 Jan 2025 15:38:35 +0000 (16:38 +0100)] 
fix EDE 22 time out detection

Extended DNS error 22 (No reachable authority) was previously detected
when `fctx_expired` fired. It turns out this function is used as a
"safety net" and the timeout detection should be caught earlier.

It was working though, because of another issue fixed by !9927. Since
this change, the recursive request timed out detection occurs before
`fctx_expired` so EDE 22 is not added to the response message anymore.

The fix of the problem is to add the EDE 22 code in two situations:

- When the dispatch code timed out (rctx_timedout) the resolver code
  checks various properties to figure out if it needs to make another
  fetch attempt. One of the paramters if the fetch expiration time. If
  it expires, the whole recursion is canceled, so it now adds the EDE 22
  code.

- If the fetch expiration time doesn't expires in the case above (and
  other parameters allows it) a new fetch attempt is made (fctx_query).
  But before the new request is actually made, the fetch expiration time
  is re-checked. It might then has elapsed, and the whole recursion is
  canceled. So it now also adds the EDE 22 code here as well.

16 months agonew: usr: add a rndc command to toggle jemalloc profiling
Aydın Mercan [Sat, 25 Jan 2025 12:53:38 +0000 (12:53 +0000)] 
new: usr: add a rndc command to toggle jemalloc profiling

The new command is `rndc memprof`. The memory profiling status is also
reported inside `rndc status`. The status also shows whether named can
toggle memory profiling or not and if the server is built with jemalloc.

Closes #4759

Merge branch '4759-add-a-trigger-to-dump-jeprof-data-or-memory-statistics' into 'main'

See merge request isc-projects/bind9!9370

16 months agoadd a rndc command to toggle jemalloc profiling
Aydın Mercan [Mon, 12 Aug 2024 15:17:05 +0000 (18:17 +0300)] 
add a rndc command to toggle jemalloc profiling

The new command is `rndc memprof`. The memory profiling status is also
reported inside `rndc status`. The status also shows whether named can
toggle memory profiling or not and if the server is built with jemalloc.

16 months agochg: ci: Ensure changelog job builds docs with the new entry
Nicki Křížek [Fri, 24 Jan 2025 18:10:32 +0000 (18:10 +0000)] 
chg: ci: Ensure changelog job builds docs with the new entry

The changelog job is supposed to test that the text from GitLab MR
title&description is valid rst syntax and can be built with sphinx. In
49128fc1, the way gitchangelog generates entries was changed - it no
longer writes to the changelog file, but generates output on stdout
instead. Ensure the generated notes is actually written to (some)
rendered file which is part of the docs so that the subsequent sphinx
build attempts to render the note.

Merge branch 'nicki/ci-fix-changelog-job' into 'main'

See merge request isc-projects/bind9!9804

16 months agoEnsure changelog job builds docs with the new entry
Nicki Křížek [Mon, 2 Dec 2024 14:31:53 +0000 (15:31 +0100)] 
Ensure changelog job builds docs with the new entry

The changelog job is supposed to test that the text from GitLab MR
title&description is valid rst syntax and can be built with sphinx. In
49128fc1, the way gitchangelog generates entries was changed - it no
longer writes to the changelog file, but generates output on stdout
instead. Ensure the generated notes is actually written to (some)
rendered file which is part of the docs so that the subsequent sphinx
build attempts to render the note.

16 months agonew: usr: adds support for EDE code 1 and 2
Colin Vidal [Fri, 24 Jan 2025 13:16:56 +0000 (13:16 +0000)] 
new: usr: adds support for EDE code 1 and 2

Add support for EDE codes 1 & 2 which might occurs during DNSSEC validation in case of unsupported RRSIG algorithm or DNSKEY digest.

See #2715

Merge branch '2715-ede-unsupported-digest-alg' into 'main'

See merge request isc-projects/bind9!9948

16 months agoadd DNSSEC EDE test for unsupported digest and alg
Colin Vidal [Mon, 20 Jan 2025 19:59:23 +0000 (20:59 +0100)] 
add DNSSEC EDE test for unsupported digest and alg

A DNSSEC validation can fail in the case where multiple DNSKEY are
available for a zone and none of them are supported, but for different
reasons: one has a DS record in the parent zone using an unsupported
digest while the other one uses an unsupported encryption algorithm.

Add a specific test case covering this flow and making sure that two
extended DNS error are provided: code 1 and 2, each of them highlighting
unsupported algorithm and digest.

16 months agotests for support for EDE 1 & 2
Colin Vidal [Mon, 13 Jan 2025 13:50:58 +0000 (14:50 +0100)] 
tests for support for EDE 1 & 2

16 months agoadd support for EDE code 1 and 2
Colin Vidal [Mon, 13 Jan 2025 13:50:01 +0000 (14:50 +0100)] 
add support for EDE code 1 and 2

Add support for EDE codes 1 (Unsupported DNSKEY Algorithm) and 2
(Unsupported DS Digest Type) which might occurs during DNSSEC
validation in case of unsupported DNSKEY algorithm or DS digest type.

Because DNSSEC internally kicks off various fetches, we need to copy
all encountered extended errors from fetch responses to the fetch
context. Upon an event, the errors from the fetch context are copied
to the client response.

16 months agonew: doc: Add linkcheck to CI
Michal Nowak [Fri, 24 Jan 2025 12:00:30 +0000 (12:00 +0000)] 
new: doc: Add linkcheck to CI

Merge branch 'mnowak/rtd-add-linkcheck' into 'main'

See merge request isc-projects/bind9!9680

16 months agoAdd linkcheck job
Michal Nowak [Fri, 24 Jan 2025 10:50:49 +0000 (11:50 +0100)] 
Add linkcheck job

16 months agoFix broken links in documentation
Michal Nowak [Fri, 24 Jan 2025 10:50:36 +0000 (11:50 +0100)] 
Fix broken links in documentation

Some detected links are not to be verified (127.*, dnssec-or-not.com)
and some I can't fix (flaticon, godaddy, icann), but they are not
crucial.

16 months agochg: test: Rewrite cipher-suites system test to pytest
Michal Nowak [Fri, 24 Jan 2025 08:53:25 +0000 (08:53 +0000)] 
chg: test: Rewrite cipher-suites system test to pytest

The minimal dnspython version to run this test is 2.5.0.

Merge branch 'mnowak/pytest_rewrite_cipher-suites' into 'main'

See merge request isc-projects/bind9!8662

16 months agoRename have_* marks to with_*
Michal Nowak [Fri, 11 Oct 2024 09:30:26 +0000 (11:30 +0200)] 
Rename have_* marks to with_*

Marks starting with "with" or "without" make more sense linguistically
than those starting with "have" or "have_not".

16 months agoTest cipher-suites after zone transfers complete
Nicki Křížek [Wed, 28 Aug 2024 13:03:27 +0000 (15:03 +0200)] 
Test cipher-suites after zone transfers complete

Ensure the zone transfers have completed (successfully or not) before
running the test cases, because they assume zone transfers have been
done.

16 months agoMake servers fixture in pytest module-wide
Nicki Křížek [Wed, 28 Aug 2024 13:00:02 +0000 (15:00 +0200)] 
Make servers fixture in pytest module-wide

The servers are setup and torn down once per each test module. All the
logs and server state persists between individual tests within the same
module. The servers fixture representing these servers should be
module-wide as well.

16 months agoRewrite cipher-suites system test to pytest
Michal Nowak [Wed, 17 Jan 2024 19:43:21 +0000 (20:43 +0100)] 
Rewrite cipher-suites system test to pytest

The minimal required dnspython version is 2.5.0 because of the need for
the "verify" argument in dns.query.tls().

16 months agoUse Debian "sid" for pylint and mypy jobs to get recent dnspython
Michal Nowak [Thu, 10 Oct 2024 17:46:22 +0000 (19:46 +0200)] 
Use Debian "sid" for pylint and mypy jobs to get recent dnspython

The base image tends to have a rather old dnspython version and when
used with pylint and mypy it produces errors about newer dnspython
features the old version does not know about.

    $ mypy "bin/tests/system/isctest/"
    bin/tests/system/isctest/query.py:55: error: Unexpected keyword argument "verify" for "tls"  [call-arg]
    /usr/lib/python3/dist-packages/dns/query.py:958: note: "tls" defined here

    $ pylint --rcfile $CI_PROJECT_DIR/.pylintrc --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE 'ans\.py')
    ************* Module isctest.query
    bin/tests/system/isctest/query.py:55:11: E1123: Unexpected keyword argument 'verify' in function call (unexpected-keyword-arg)

16 months agoAdd isctest.query.tls() function
Michal Nowak [Wed, 17 Jan 2024 19:47:42 +0000 (20:47 +0100)] 
Add isctest.query.tls() function

When explicitly set to True, the "verify" argument lets dnspython verify
certificates used for the connection. As most certificates in the system
test will inevitably be self-signed, the "verify" argument defaults to
False.

The "verify" argument is present in dnspython since the version 2.5.0.

16 months agoAdd "without_fips" mark
Michal Nowak [Wed, 17 Jan 2024 19:44:27 +0000 (20:44 +0100)] 
Add "without_fips" mark

The "without_fips" mark disables test function when BIND 9 was built
with the FIPS mode enabled as not everything works in FIPS-enabled
builds.

16 months agorem: dev: Clean up unused result codes
Evan Hunt [Fri, 24 Jan 2025 00:58:06 +0000 (00:58 +0000)] 
rem: dev: Clean up unused result codes

A number of result codes are obsolete and can be removed. Others, including `ISC_R_NOMEMORY`, are still checked in various places even though they can't occur any longer. These have been cleaned up.

Merge branch 'each-cleanup-results' into 'main'

See merge request isc-projects/bind9!9942

16 months agodeduplicate result codes
Evan Hunt [Thu, 9 Jan 2025 04:13:34 +0000 (20:13 -0800)] 
deduplicate result codes

ISCCC_R_SYNTAX, ISCCC_R_EXPIRED, and ISCCC_R_CLOCKSKEW have the
same usage and text formats as DNS_R_SYNTAX, DNS_R_EXPIRED and
DNS_R_CLOCKSCREW respectively. this was originally done because
result codes were defined in separate libraries, and some tool
might be linked with libisccc but not libdns. as the result codes
are now defined in only one place, there's no need to retain the
duplicates.

16 months agoclean up result codes that are never used
Evan Hunt [Wed, 8 Jan 2025 23:41:55 +0000 (15:41 -0800)] 
clean up result codes that are never used

the following result codes are obsolete and have been removed
from result.h and result.c:

        - ISC_R_NOTHREADS
        - ISC_R_BOUND
        - ISC_R_NOTBOUND
        - ISC_R_NOTDIRECTORY
        - ISC_R_EMPTY
        - ISC_R_NOTBLOCKING
        - ISC_R_INPROGRESS
        - ISC_R_WOULDBLOCK

        - DNS_R_TOOMANYHOPS
        - DNS_R_NOREDATA
        - DNS_R_BADCKSUM
        - DNS_R_MOREDATA
        - DNS_R_NOVALIDDS
        - DNS_R_UNKNOWNOPT
        - DNS_R_NOVALIDKEY
        - DNS_R_NTACOVERED

        - DST_R_COMPUTESECRETFAILURE
        - DST_R_NORANDOMNESS
        - DST_R_NOCRYPTO

16 months agoclean up uses of DST_R_NOCRYPTO
Evan Hunt [Wed, 8 Jan 2025 21:50:53 +0000 (13:50 -0800)] 
clean up uses of DST_R_NOCRYPTO

building BIND without crypto support is no longer possible.
consequently this result code is never sent, and therefore we
don't need code in calling functions to handle it.

16 months agoclean up uses of ISC_R_NOMEMORY
Evan Hunt [Wed, 8 Jan 2025 03:03:07 +0000 (19:03 -0800)] 
clean up uses of ISC_R_NOMEMORY

the isc_mem allocation functions can no longer fail; as a result,
ISC_R_NOMEMORY is now rarely used: only when an external library
such as libjson-c or libfstrm could return NULL. (even in
these cases, arguably we should assert rather than returning
ISC_R_NOMEMORY.)

code and comments that mentioned ISC_R_NOMEMORY have been
cleaned up, and the following functions have been changed to
type void, since (in most cases) the only value they could
return was ISC_R_SUCCESS:

- dns_dns64_create()
- dns_dyndb_create()
- dns_ipkeylist_resize()
- dns_kasp_create()
- dns_kasp_key_create()
- dns_keystore_create()
- dns_order_create()
- dns_order_add()
- dns_peerlist_new()
- dns_tkeyctx_create()
- dns_view_create()
- dns_zone_setorigin()
- dns_zone_setfile()
- dns_zone_setstream()
- dns_zone_getdbtype()
- dns_zone_setjournal()
- dns_zone_setkeydirectory()
- isc_lex_openstream()
- isc_portset_create()
- isc_symtab_create()

(the exception is dns_view_create(), which could have returned
other error codes in the event of a crypto library failure when
calling isc_file_sanitize(), but that should be a RUNTIME_CHECK
anyway.)

16 months agochg: ci: Set stricter limits for respdiff testing
Nicki Křížek [Thu, 23 Jan 2025 17:26:40 +0000 (17:26 +0000)] 
chg: ci: Set stricter limits for respdiff testing

Adjust the limit of maximum disagreements in respdiff results based on
recent pipeline results.

The respdiff and respdiff:asan seem to have almost identical results,
typically around 0.07 % of differences with ocassional spikes up to
around 0.11 %. Similar results are for respdiff:tsan, perhaps with more
common spikes with values up to around 0.12 %. Set the limit to 0.15 %
to allow for some tolerance due to network conditions, time of day etc.

The respdiff:third-party has a slightly higher disagreements average,
with typical values being around 0.12 %. Set the limit to 0.2 %.

Exceeding either of those values should be quite clear indication that
some resolution behaviour has changed, since the values appear to be
very stable within the newly configured limits.

Merge branch 'nicki/ci-respdiff-limits' into 'main'

See merge request isc-projects/bind9!9950

16 months agoSet stricter limits for respdiff testing
Nicki Křížek [Mon, 13 Jan 2025 13:29:24 +0000 (14:29 +0100)] 
Set stricter limits for respdiff testing

Adjust the limit of maximum disagreements in respdiff results based on
recent pipeline results.

The respdiff and respdiff:asan seem to have almost identical results,
typically around 0.07 % of differences with ocassional spikes up to
around 0.11 %. Similar results are for respdiff:tsan, perhaps with more
common spikes with values up to around 0.12 %. Set the limit to 0.15 %
to allow for some tolerance due to network conditions, time of day etc.

The respdiff:third-party has a slightly higher disagreements average,
with typical values being around 0.12 %. Set the limit to 0.2 %.

Exceeding either of those values should be quite clear indication that
some resolution behaviour has changed, since the values appear to be
very stable within the newly configured limits.

16 months agochg: doc: Document how secondaries refresh a zone in the ARM
Matthijs Mekking [Thu, 23 Jan 2025 15:52:54 +0000 (15:52 +0000)] 
chg: doc: Document how secondaries refresh a zone in the ARM

Closes #5123

Merge branch '5123-document-refreshing-a-secondary' into 'main'

See merge request isc-projects/bind9!9966

16 months agoDocument how secondaries refresh a zone in the ARM
Matthijs Mekking [Mon, 20 Jan 2025 15:47:25 +0000 (16:47 +0100)] 
Document how secondaries refresh a zone in the ARM

We have a KB article that describes this, put a condensed version into
the ARM.

16 months agofix: doc: Clarify dnssec-signzone interval option
Matthijs Mekking [Thu, 23 Jan 2025 11:12:33 +0000 (11:12 +0000)] 
fix: doc: Clarify dnssec-signzone interval option

There was confusion about whether the interval was calculated from
the validity period provided on the command line (with -s and -e),
or from the signature being replaced.

Add text to clarify that the interval is calculated from the new
validity period.

Closes #5128

Merge branch '5128-clarify-dnssec-signzone-interval' into 'main'

See merge request isc-projects/bind9!9955

16 months agoClarify dnssec-signzone interval option
Matthijs Mekking [Wed, 15 Jan 2025 12:47:48 +0000 (13:47 +0100)] 
Clarify dnssec-signzone interval option

There was confusion about whether the interval was calculated from
the validity period provided on the command line (with -s and -e),
or from the signature being replaced.

Add text to clarify that the interval is calculated from the new
validity period.

16 months agofix: usr: Fix a bug in dnssec-signzone related to keys being offline
Matthijs Mekking [Thu, 23 Jan 2025 10:36:15 +0000 (10:36 +0000)] 
fix: usr: Fix a bug in dnssec-signzone related to keys being offline

In the case when `dnssec-signzone` is called on an already signed zone, and the private key file is unavailable, a signature that needs to be refreshed may be dropped without being able to generate a replacement. This has been fixed.

Closes #5126

Merge branch '5126-dnssec-signzone-retain-rrsig-if-key-is-offline' into 'main'

See merge request isc-projects/bind9!9951

16 months agodnssec-signzone retain signature if key is offline
Matthijs Mekking [Tue, 14 Jan 2025 14:18:40 +0000 (15:18 +0100)] 
dnssec-signzone retain signature if key is offline

Track inside the dns_dnsseckey structure whether we have seen the
private key, or if this key only has a public key file.

If the key only has a public key file, or a DNSKEY reference in the
zone, mark the key 'pubkey'. In dnssec-signzone, if the key only
has a public key available, consider the key to be offline. Any
signatures that should be refreshed for which the key is not available,
retain the signature.

So in the code, 'expired' becomes 'refresh', and the new 'expired'
is only used to determine whether we need to keep the signature if
the corresponding key is not available (retaining the signature if
it is not expired).

In the 'keysthatsigned' function, we can remove:
  - key->force_publish = false;
  - key->force_sign = false;

because they are redundant ('dns_dnsseckey_create' already sets these
values to false).

16 months agoTest dnssec-signzone with private key file missing
Matthijs Mekking [Tue, 14 Jan 2025 13:10:20 +0000 (14:10 +0100)] 
Test dnssec-signzone with private key file missing

Add a test case for the scenario below.

There is a case when signing a zone with dnssec-signzone where the
private key file is moved outside the key directory (for offline
ksk purposes), and then the zone is resigned. The signature of the
DNSKEY needs refreshing, but is not expired.

Rather than removing the signature without having a valid replacement,
leave the signature in the zone (despite it needs to be refreshed).

16 months agofix: dev: Fix possible truncation in dns_keymgr_status()
Matthijs Mekking [Thu, 23 Jan 2025 09:40:05 +0000 (09:40 +0000)] 
fix: dev: Fix possible truncation in dns_keymgr_status()

If the generated status output exceeds 4096 it was silently truncated, now we output that the status was truncated.

Closes #4180

Merge branch '4180-possible-truncation-in-dns_keymgr_status' into 'main'

See merge request isc-projects/bind9!9905

16 months agoFix possible truncation in dns_keymgr_status()
Matthijs Mekking [Thu, 12 Dec 2024 13:40:43 +0000 (14:40 +0100)] 
Fix possible truncation in dns_keymgr_status()

If the generated status output exceeds 4096 it was silently truncated,
now we output that the status was truncated.

16 months agofix: usr: Yaml string not terminated in negative response in delv
Mark Andrews [Wed, 22 Jan 2025 23:55:50 +0000 (23:55 +0000)] 
fix: usr: Yaml string not terminated in negative response in delv

Closes #5098

Merge branch '5098-missing-yaml-string-termination-delv' into 'main'

See merge request isc-projects/bind9!9922

16 months agoCheck delv +yaml negative response output
Mark Andrews [Sun, 15 Dec 2024 23:29:26 +0000 (10:29 +1100)] 
Check delv +yaml negative response output

16 months agoTerminate yaml string after negative comment
Mark Andrews [Sun, 15 Dec 2024 22:57:30 +0000 (09:57 +1100)] 
Terminate yaml string after negative comment

16 months agonew: usr: Add support for multiple extended DNS errors
Colin Vidal [Wed, 22 Jan 2025 21:32:28 +0000 (21:32 +0000)] 
new: usr: Add support for multiple extended DNS errors

Extended DNS error mechanism (EDE) may have several errors raised during a DNS resolution. `named` is now able to add up to three EDE codes in a DNS response. In the case of duplicate error codes, only the first one will be part of the DNS response.

Closes #5085

Merge branch '5085-multiple-ede' into 'main'

See merge request isc-projects/bind9!9952

16 months agoadd unit tests covering multiple EDE support
Colin Vidal [Tue, 14 Jan 2025 16:15:42 +0000 (17:15 +0100)] 
add unit tests covering multiple EDE support

16 months agoadd support for multiple EDE
Colin Vidal [Tue, 14 Jan 2025 16:13:42 +0000 (17:13 +0100)] 
add support for multiple EDE

Extended DNS error mechanism (EDE) enables to have several EDE raised
during a DNS resolution (typically, a DNSSEC query will do multiple
fetches which each of them can have an error). Add support to up to 3
EDE errors in an DNS response. If duplicates occur (two EDEs with the
same code, the extra text is not compared), only the first one will be
part of the DNS answer.

Because the maximum number of EDE is statically fixed, `ns_client_t`
object own a static vector of `DNS_DE_MAX_ERRORS` (instead of a linked
list, for instance). The array can be fully filled (all slots point to
an allocated `dns_ednsopt_t` object) or partially filled (or
empty). In such case, the first NULL slot means there is no more EDE
objects.

16 months agochg: dev: Use a suitable response in tcp_connected() when initiating a read
Arаm Sаrgsyаn [Wed, 22 Jan 2025 13:41:25 +0000 (13:41 +0000)] 
chg: dev: Use a suitable response in tcp_connected() when initiating a read

When 'ISC_R_TIMEDOUT' is received in 'tcp_recv()', it times out the
oldest response in the active responses queue, and only after that it
checks whether other active responses have also timed out. So when
setting a timeout value for a read operation after a successful
connection, it makes sense to take the timeout value from the oldest
response in the active queue too, because, theoretically, the responses
can have different timeout values, e.g. when the TCP dispatch is shared.
Currently 'resp' is always NULL. Previously when connect and read timeouts
were not separated in dispatch this affected only logging, but now since
we are setting a new timeout after a successful connection, we need to
choose a suitable response from the active queue.

Merge branch 'aram/dispatch-tcp_connected-fix' into 'main'

See merge request isc-projects/bind9!9927

16 months agoClean up fctx->next_timeout
Aram Sargsyan [Sat, 21 Dec 2024 09:10:20 +0000 (09:10 +0000)] 
Clean up fctx->next_timeout

Since the support for non-zero values of stale-answer-client-timeout
was removed in bd7463914fe6375e3e9157f305c60d0172f2b312, 'next_timeout'
is unused. Clean it up.