]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoAdd test for dns_qp_lookup() chains pspacek/hypothesis-unit-tests 8964/head
Petr Špaček [Thu, 9 May 2024 08:07:28 +0000 (10:07 +0200)] 
Add test for dns_qp_lookup() chains

Reproduces a problem on BIND BIND 9.19.25-dev 9357019

Related: #4717

2 years agoreproduces an issue in lookup() - BIND 657ee2b997d822d43638a8f3752fce81c2cf0410
Petr Špaček [Mon, 29 Apr 2024 13:45:03 +0000 (15:45 +0200)] 
reproduces an issue in lookup() - BIND 657ee2b997d822d43638a8f3752fce81c2cf0410

2 years agolookup & iterator test seems to work
Petr Špaček [Fri, 26 Apr 2024 19:34:18 +0000 (21:34 +0200)] 
lookup & iterator test seems to work

2 years agoresurrect QPIterator tests and keep full copy of data model in iterator
Petr Špaček [Fri, 26 Apr 2024 14:04:23 +0000 (16:04 +0200)] 
resurrect QPIterator tests and keep full copy of data model in iterator

2 years agoqp_dns_loopup test works
Petr Špaček [Fri, 26 Apr 2024 12:32:39 +0000 (14:32 +0200)] 
qp_dns_loopup test works

In rouhly half of test executions pytest hangs indefinitely - tested
against BIND commit a863450 which contains bug in fix_iterator() QP
function. Repeated pstack confirms that execution is cycling in
fix_iterator().

2 years agoFix off by one and related type errors in DNS name generator
Petr Špaček [Fri, 26 Apr 2024 12:18:23 +0000 (14:18 +0200)] 
Fix off by one and related type errors in DNS name generator

2 years agoWIP: faster turnaround for debug
Petr Špaček [Fri, 26 Apr 2024 07:54:47 +0000 (09:54 +0200)] 
WIP: faster turnaround for debug

2 years agoIgnore .hypothesis test metadata directory
Petr Špaček [Fri, 26 Apr 2024 07:50:41 +0000 (09:50 +0200)] 
Ignore .hypothesis test metadata directory

2 years agoWIP: single iterator test which covers next() and prev() into more depth
Petr Špaček [Thu, 25 Apr 2024 16:07:25 +0000 (18:07 +0200)] 
WIP: single iterator test which covers next() and prev() into more depth

2 years agoWIP: it does not explore iterators in sufficient depth
Petr Špaček [Thu, 25 Apr 2024 13:38:24 +0000 (15:38 +0200)] 
WIP: it does not explore iterators in sufficient depth

2 years agoWIP: generic single-step iteration checkers
Petr Špaček [Thu, 25 Apr 2024 09:40:23 +0000 (11:40 +0200)] 
WIP: generic single-step iteration checkers

2 years agoWIP: broken values_agree()
Petr Špaček [Wed, 24 Apr 2024 16:18:48 +0000 (18:18 +0200)] 
WIP: broken values_agree()

2 years agoAdd basic forward iteration & key check
Petr Špaček [Wed, 24 Apr 2024 14:14:50 +0000 (16:14 +0200)] 
Add basic forward iteration & key check

2 years agoAdd basic add/delete name QP trie unit test with Python hypothesis
Petr Špaček [Tue, 23 Apr 2024 13:55:04 +0000 (15:55 +0200)] 
Add basic add/delete name QP trie unit test with Python hypothesis

2 years agoWIP: qp tests based on python hypothesis
Petr Špaček [Mon, 22 Apr 2024 20:30:06 +0000 (22:30 +0200)] 
WIP: qp tests based on python hypothesis

2 years agoIgnore autogenerated CFFI files in tests/dns
Petr Špaček [Mon, 22 Apr 2024 13:37:56 +0000 (15:37 +0200)] 
Ignore autogenerated CFFI files in tests/dns

2 years agoSort tests/dns/.gitignore
Petr Špaček [Mon, 22 Apr 2024 13:37:21 +0000 (15:37 +0200)] 
Sort tests/dns/.gitignore

2 years agoWIP: rename and move CFFI test files into tests/dns
Petr Špaček [Mon, 22 Apr 2024 13:37:01 +0000 (15:37 +0200)] 
WIP: rename and move CFFI test files into tests/dns

2 years agoWIP: test for name_downcase and name_hash
Petr Špaček [Mon, 22 Apr 2024 13:18:25 +0000 (15:18 +0200)] 
WIP: test for name_downcase and name_hash

2 years agoWIP: unit test skeleton, no integration yet
Petr Špaček [Mon, 22 Apr 2024 11:15:17 +0000 (13:15 +0200)] 
WIP: unit test skeleton, no integration yet

2 years agoWIP: copy from stepan/hypothesis 6250d2306a3c4910d175c4e720c17f84f772ed75
Petr Špaček [Mon, 22 Apr 2024 11:14:54 +0000 (13:14 +0200)] 
WIP: copy from stepan/hypothesis 6250d2306a3c4910d175c4e720c17f84f772ed75

2 years agoWIP: mctx + de/compression
Petr Špaček [Mon, 22 Apr 2024 11:14:33 +0000 (13:14 +0200)] 
WIP: mctx + de/compression

2 years agoWIP
Petr Špaček [Sun, 21 Apr 2024 21:27:23 +0000 (23:27 +0200)] 
WIP

2 years agoMerge branch 'pspacek/doc-rfc-ref-update' into 'main'
Petr Špaček [Wed, 8 May 2024 07:07:48 +0000 (07:07 +0000)] 
Merge branch 'pspacek/doc-rfc-ref-update' into 'main'

Update RFC references in documentation

See merge request isc-projects/bind9!9020

2 years agoUpdate reference for Catalog Zones spec to RFC9432
Petr Špaček [Tue, 7 May 2024 11:34:51 +0000 (13:34 +0200)] 
Update reference for Catalog Zones spec to RFC9432

2 years agoUpdate KSK root sentinel references
Petr Špaček [Tue, 7 May 2024 11:24:43 +0000 (13:24 +0200)] 
Update KSK root sentinel references

The mechanism was published as RFC 8509. I've briefly looked at diff
between versions -08 and the RFC and did not find significant protocol
change. Quick manual check confirms what we seem to comply with the
published protocol.

2 years agoMention RFC 9276 Guidance for NSEC3 Parameter Settings
Petr Špaček [Tue, 7 May 2024 11:11:03 +0000 (13:11 +0200)] 
Mention RFC 9276 Guidance for NSEC3 Parameter Settings

Draft was eventually published as RFC 9276 but we did not update our
docs. Also add couple mentions in relevant places in the ARM and
dnssec-signzone man page, mainly around "do not touch" places.

2 years agoUpdate DNSSEC Operational Practices references to Version 2
Petr Špaček [Tue, 7 May 2024 11:10:07 +0000 (13:10 +0200)] 
Update DNSSEC Operational Practices references to Version 2

RFC 4641 was obsoleted by 6781.

2 years agoMerge branch '4704-svcb-https-bind9-and-dig-fail-to-parse-packet-if-zero-svcpriority...
Mark Andrews [Tue, 7 May 2024 02:07:21 +0000 (02:07 +0000)] 
Merge branch '4704-svcb-https-bind9-and-dig-fail-to-parse-packet-if-zero-svcpriority-and-existing-svcparams' into 'main'

Resolve "SVCB/HTTPS: Bind9 and Dig fail to parse packet if zero SvcPriority and existing SvcParams"

Closes #4704

See merge request isc-projects/bind9!9000

2 years agoAdd CHANGES note for [GL #4704]
Mark Andrews [Wed, 1 May 2024 04:59:15 +0000 (14:59 +1000)] 
Add CHANGES note for [GL #4704]

2 years agoOnly check SVBC alias forms at higher levels
Mark Andrews [Wed, 1 May 2024 04:29:20 +0000 (14:29 +1000)] 
Only check SVBC alias forms at higher levels

Allow SVBC (HTTPS) alias form with parameters to be accepted from
the wire and when transfered.  This is for possible future extensions.

2 years agoMerge branch '4357-treat-notfile-as-eof' into 'main'
Mark Andrews [Tue, 7 May 2024 01:03:00 +0000 (01:03 +0000)] 
Merge branch '4357-treat-notfile-as-eof' into 'main'

Remove infinite loop on ISC_R_NOFILE

Closes #4357

See merge request isc-projects/bind9!9004

2 years agoAdd CHANGES note for [GL #4357]
Mark Andrews [Thu, 18 Jan 2024 08:04:54 +0000 (19:04 +1100)] 
Add CHANGES note for [GL #4357]

2 years agoTest including a directory in a zone file
Mark Andrews [Thu, 18 Jan 2024 08:08:14 +0000 (19:08 +1100)] 
Test including a directory in a zone file

2 years agoRemove infinite loop on ISC_R_NOFILE
Mark Andrews [Thu, 18 Jan 2024 07:54:09 +0000 (18:54 +1100)] 
Remove infinite loop on ISC_R_NOFILE

When parsing a zonefile named-checkzone (and others) could loop
infinitely if a directory was $INCLUDED.  Record the error and treat
as EOF when looking for multiple errors.

This was found by Eric Sesterhenn from X41.

2 years agoMerge branch '4353-fix-nibbles' into 'main'
Mark Andrews [Mon, 6 May 2024 23:58:36 +0000 (23:58 +0000)] 
Merge branch '4353-fix-nibbles' into 'main'

Address infinite loop when processing $GENERATE

Closes #4353

See merge request isc-projects/bind9!9003

2 years agoAdd CHANGES note for [GL #4353]
Mark Andrews [Fri, 19 Jan 2024 01:45:55 +0000 (12:45 +1100)] 
Add CHANGES note for [GL #4353]

2 years agoTest $GENERATE in nibble mode with a negative value
Mark Andrews [Fri, 19 Jan 2024 01:42:13 +0000 (12:42 +1100)] 
Test $GENERATE in nibble mode with a negative value

Negative values used to cause $GENERATE to loop forever.

2 years agoAddress infinite loop when processing $GENERATE
Mark Andrews [Fri, 19 Jan 2024 01:37:10 +0000 (12:37 +1100)] 
Address infinite loop when processing $GENERATE

In nibble mode if the value to be converted was negative the parser
would loop forever.  Process the value as an unsigned int instead
of as an int to prevent sign extension when shifting.

This was found by Eric Sesterhenn from X41.

2 years agoMerge branch 'mnowak/fedora-40' into 'main'
Michal Nowak [Mon, 6 May 2024 17:40:55 +0000 (17:40 +0000)] 
Merge branch 'mnowak/fedora-40' into 'main'

Add Fedora 40

See merge request isc-projects/bind9!8979

2 years agoSupress the leak detection in xmlNewGlobalState
Michal Nowak [Wed, 24 Apr 2024 15:33:52 +0000 (17:33 +0200)] 
Supress the leak detection in xmlNewGlobalState

2 years agoAdd Fedora 40
Michal Nowak [Wed, 27 Mar 2024 18:11:11 +0000 (19:11 +0100)] 
Add Fedora 40

2 years agoMerge branch 'mnowak/ubuntu-24.04-noble-numbat' into 'main'
Michal Nowak [Mon, 6 May 2024 16:35:59 +0000 (16:35 +0000)] 
Merge branch 'mnowak/ubuntu-24.04-noble-numbat' into 'main'

Add Ubuntu 24.04 LTS (Noble Numbat)

See merge request isc-projects/bind9!8980

2 years agoAdd Ubuntu 24.04 LTS (Noble Numbat)
Michal Nowak [Wed, 24 Apr 2024 16:56:21 +0000 (18:56 +0200)] 
Add Ubuntu 24.04 LTS (Noble Numbat)

2 years agoMerge branch 'mnowak/openbsd-7.5' into 'main'
Michal Nowak [Mon, 6 May 2024 15:20:24 +0000 (15:20 +0000)] 
Merge branch 'mnowak/openbsd-7.5' into 'main'

Add OpenBSD 7.5

See merge request isc-projects/bind9!8965

2 years agoAdd OpenBSD 7.5
Michal Nowak [Mon, 22 Apr 2024 14:48:19 +0000 (16:48 +0200)] 
Add OpenBSD 7.5

2 years agoMerge branch '4711-stress-test-finer-runtime-granularity' into 'main'
Michal Nowak [Mon, 6 May 2024 14:05:22 +0000 (14:05 +0000)] 
Merge branch '4711-stress-test-finer-runtime-granularity' into 'main'

Add short version of "stress" tests to MR-triggered pipelines

Closes #4711

See merge request isc-projects/bind9!9002

2 years agoAdd short "stress" test jobs
Michal Nowak [Thu, 2 May 2024 15:49:42 +0000 (17:49 +0200)] 
Add short "stress" test jobs

2 years agoRename "stress" tests to long "stress" tests
Michal Nowak [Thu, 2 May 2024 15:37:01 +0000 (17:37 +0200)] 
Rename "stress" tests to long "stress" tests

2 years agoRevert "Drop parallel build from stress tests"
Michal Nowak [Thu, 2 May 2024 15:24:31 +0000 (17:24 +0200)] 
Revert "Drop parallel build from stress tests"

This reverts commit 3fd7e7c81f81e21adebde2930fe511fe335f825e.

In AWS this is no longer a concern.

2 years agoMerge branch '4543-reenable-unreachable-dnssec-checks' into 'main'
Nicki Křížek [Mon, 6 May 2024 13:15:49 +0000 (13:15 +0000)] 
Merge branch '4543-reenable-unreachable-dnssec-checks' into 'main'

Re-enable accidentally disabled dnssec checks

Closes #4543

See merge request isc-projects/bind9!8667

2 years agoUpdate hours-vs-days test
Matthijs Mekking [Wed, 31 Jan 2024 12:55:29 +0000 (13:55 +0100)] 
Update hours-vs-days test

This test is outdated because it tested the 'sig-validity-interval'
option that has been replaced by dnssec-policy's 'signatures-validity',
'signatures-refresh', and 'signatures-jitter' options.

Nevertheless, it tests if the jitter is spread correctly.

Update the test to make use of 'signatures-jitter', set the value
to 1 day (meaning resign in 499 days since 'signatures-validity' is
set to 500 days).

Note that this previously changed erroneously the refresh value to
449 days (should have been 499 days, but that is not allowed by
checkconf, since it is above 90% of 'signatures-validity').

2 years agoFix dnssec system test iterations too high
Matthijs Mekking [Tue, 30 Jan 2024 16:21:34 +0000 (17:21 +0100)] 
Fix dnssec system test iterations too high

After we have changed the maximum allowed iterations to 51 for signing,
the NSEC3 chain has changed and requires one more NSEC to be returned
in the answer (plus corresponding RRSIG). So the expected number or
records in the authority section is now 8.

2 years agoOffline KSK and dnssec-policy not yet supported
Matthijs Mekking [Tue, 30 Jan 2024 16:10:28 +0000 (17:10 +0100)] 
Offline KSK and dnssec-policy not yet supported

If the key is offline and the keymgr runs, it will treat it as a missing key,
and generate a new key (according to the policy). Fix the test by putting
back the KSK temporarily when we run 'rndc loadkeys'.

2 years agoFix ZSK rollovers in dnssec system test
Matthijs Mekking [Tue, 30 Jan 2024 15:16:47 +0000 (16:16 +0100)] 
Fix ZSK rollovers in dnssec system test

1. When generating keys, don't set timing metadata. Otherwise keys
   are considered to be in use and won't be selected when dnssec-policy
   starts a new key rollover.

2. Add an extra check to make sure the new ZSK (zsk2) is prepublished.
   Also add a check to make sure it has become active.

3. When using dnssec-settime, add -s to also write to key state files.

2 years agoEnsure dnssec test doesn't leak queries to root servers
Tom Krizek [Fri, 19 Jan 2024 15:01:47 +0000 (16:01 +0100)] 
Ensure dnssec test doesn't leak queries to root servers

The config was recently modified to ensure ns4 won't leak any queries to
root servers. However, the test wasn't executed and it turns out the way
this was handled actually broke the test case. Add our custom root hint
to both of the views to ensure the test can still pass without leaking
any queries.

2 years agoRe-enable accidentally disabled dnssec checks
Tom Krizek [Fri, 19 Jan 2024 15:00:46 +0000 (16:00 +0100)] 
Re-enable accidentally disabled dnssec checks

Remove the premature exit statement which made the rest of the checks
unreachable.

2 years agoMerge branch '3323-different-rpz-soa-ttl' into 'main'
Matthijs Mekking [Mon, 6 May 2024 10:10:42 +0000 (10:10 +0000)] 
Merge branch '3323-different-rpz-soa-ttl' into 'main'

RPZ response's SOA record is incorrectly set to 1

Closes #3323

See merge request isc-projects/bind9!8998

2 years agoAdd release note and CHANGES for #3323
Matthijs Mekking [Tue, 30 Apr 2024 09:21:59 +0000 (11:21 +0200)] 
Add release note and CHANGES for #3323

2 years agoRPZ response's SOA record is incorrectly set to 1
Matthijs Mekking [Tue, 30 Apr 2024 09:14:42 +0000 (11:14 +0200)] 
RPZ response's SOA record is incorrectly set to 1

An RPZ response's SOA record TTL is set to 1 instead of the SOA TTL,
a boolean value is passed on to query_addsoa, which is supposed to be
a TTL value. I don't see what value is appropriate to be used for
overriding, so we will pass UINT32_MAX.

2 years agoMerge branch 'matthijs-offline-ksk-add-ksk-on-sign' into 'main'
Matthijs Mekking [Mon, 6 May 2024 09:30:10 +0000 (09:30 +0000)] 
Merge branch 'matthijs-offline-ksk-add-ksk-on-sign' into 'main'

Add DNSKEY record for KSK when creating the SKR

See merge request isc-projects/bind9!8986

2 years agoRetrieve DNSKEY TTL from policy
Matthijs Mekking [Fri, 3 May 2024 12:04:58 +0000 (14:04 +0200)] 
Retrieve DNSKEY TTL from policy

The desired DNSKEY TTL is configured in the policy so set it to that
value on new RRsets. Note that the same TTL is used for CDS and CDNSKEY.

2 years agoRename create_cds to create_ksk
Matthijs Mekking [Thu, 25 Apr 2024 15:28:06 +0000 (17:28 +0200)] 
Rename create_cds to create_ksk

Now that this function also creates the DNSKEY record for the KSKs,
as well as other associated records such as CDS and CDNSKEY, rename
the function to something slightly better.

2 years agoAdd DNSKEY rr corresponding to the KSK to the SKR
Matthijs Mekking [Thu, 25 Apr 2024 15:25:04 +0000 (17:25 +0200)] 
Add DNSKEY rr corresponding to the KSK to the SKR

When signing a KSR, add the DNSKEY records from the signing KSK(s) to
the DNSKEY RRset prior to signing.

2 years agoDon't add KSKs to the KSR
Matthijs Mekking [Thu, 25 Apr 2024 14:00:09 +0000 (16:00 +0200)] 
Don't add KSKs to the KSR

Creating the KSR happens on the "ZSK side". The KSK is offline and while
the public key and state file may be present, draft-icann-dnssec-keymgmt-01.txt
suggest that the KSR only contains ZSKs.

This is also what knot dns does, so it would also be in the spirit of
interoperability.

2 years agoMerge branch 'matthijs-fix-dnssec-ksr-version-missing' into 'main'
Matthijs Mekking [Mon, 6 May 2024 08:40:46 +0000 (08:40 +0000)] 
Merge branch 'matthijs-fix-dnssec-ksr-version-missing' into 'main'

Fix missing version in KSR

See merge request isc-projects/bind9!8983

2 years agoFix missing version in KSR
Matthijs Mekking [Thu, 25 Apr 2024 13:48:49 +0000 (15:48 +0200)] 
Fix missing version in KSR

The final line in a KSR ";; KeySigningRequest generated at ..." was
missing the version number, that has now been fixed.

Thanks Libor Peltan for reporting.

2 years agoMerge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.25' into 'main'
Michal Nowak [Fri, 3 May 2024 14:01:59 +0000 (14:01 +0000)] 
Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.25' into 'main'

Set up version and release notes for BIND 9.19.25

See merge request isc-projects/bind9!9005

2 years agoSet up release notes for BIND 9.19.25
Michal Nowak [Fri, 3 May 2024 13:51:53 +0000 (15:51 +0200)] 
Set up release notes for BIND 9.19.25

2 years agoUpdate BIND version to 9.19.25-dev
Michal Nowak [Fri, 3 May 2024 13:51:53 +0000 (15:51 +0200)] 
Update BIND version to 9.19.25-dev

2 years agoMerge branch '4710-qpcache-crash-on-assert-in-decref' into 'main'
Arаm Sаrgsyаn [Thu, 2 May 2024 10:25:55 +0000 (10:25 +0000)] 
Merge branch '4710-qpcache-crash-on-assert-in-decref' into 'main'

Fix a bug in expireheader() call arguments order

Closes #4710

See merge request isc-projects/bind9!9001

2 years agoFix a bug in expireheader() call arguments order
Aram Sargsyan [Thu, 2 May 2024 08:33:51 +0000 (08:33 +0000)] 
Fix a bug in expireheader() call arguments order

The expireheader() call in the expire_ttl_headers() function
is erroneous as it passes the 'nlocktypep' and 'tlocktypep'
arguments in a wrong order, which then causes an assertion
failure.

Fix the order of the arguments so it corresponds to the function's
prototype.

2 years agoMerge branch '4702-qpiter-fix' into 'main'
Evan Hunt [Wed, 1 May 2024 08:13:58 +0000 (08:13 +0000)] 
Merge branch '4702-qpiter-fix' into 'main'

dns_qp_lookup() doesn't handle searches for escaped characters well

Closes #4702

See merge request isc-projects/bind9!8999

2 years agoCHANGES for [GL #4702]
Evan Hunt [Tue, 30 Apr 2024 22:22:03 +0000 (15:22 -0700)] 
CHANGES for [GL #4702]

2 years agohandle QP lookups involving escaped characters better
Evan Hunt [Tue, 30 Apr 2024 21:23:43 +0000 (14:23 -0700)] 
handle QP lookups involving escaped characters better

in QP keys, characters that are not common in DNS names are
encoded as two-octet sequences. this caused a glitch in iterator
positioning when some lookups failed.

consider the case where we're searching for "\009" (represented
in a QP key as {0x03, 0x0c}) and a branch exists for "\000"
(represented as {0x03, 0x03}). we match on the 0x03, and continue
to search down. at the point where we find we have no match,
we need to pop back up to the branch before the 0x03 - which may
be multiple levels up the stack - before we position the iterator.

2 years agoadd another test case for an incorrect QP iterator position
Evan Hunt [Tue, 30 Apr 2024 07:16:45 +0000 (00:16 -0700)] 
add another test case for an incorrect QP iterator position

build a database tree with names containing control characters,
search for another control character, and verify the iterator is
positioned correctly.

2 years agoAdd a unit test case for converting \000\009
Matthijs Mekking [Tue, 30 Apr 2024 15:36:47 +0000 (17:36 +0200)] 
Add a unit test case for converting \000\009

Sanity checking that this domain converts to the key I am expecting.

Also fix some of the other names that had trailing 0x02 bits.

2 years agoadd a test method to print QP keys
Evan Hunt [Tue, 30 Apr 2024 08:22:39 +0000 (01:22 -0700)] 
add a test method to print QP keys

add a method qp_test_printkey() to print the name encoded in a QP key.

2 years agoMerge branch 'each-qpcache-cleanup' into 'main'
Evan Hunt [Tue, 30 Apr 2024 20:28:52 +0000 (20:28 +0000)] 
Merge branch 'each-qpcache-cleanup' into 'main'

clean up and speed up qpcache

See merge request isc-projects/bind9!8987

2 years agofix more ambiguous struct names
Evan Hunt [Mon, 29 Apr 2024 22:45:26 +0000 (15:45 -0700)] 
fix more ambiguous struct names

there were some structure names used in qpcache.c and qpzone.c that
were too similar to each other and could be confusing when debugging.
they have been changed as follows:

in qcache.c:
- changed_t was unused, and has been removed
- search_t -> qpc_search_t
- qpdb_rdatasetiter_t -> qpc_rditer_t
- qpdb_dbiterator_t -> qpc_dbiter_t

in qpzone.c:
- qpdb_changed_t -> qpz_changed_t
- qpdb_changedlist_t -> qpz_changedlist_t
- qpdb_version_t -> qpz_version_t
- qpdb_versionlist_t -> qpz_versionlist_t
- qpdb_search_t -> qpz_search_t
- qpdb_load_t -> qpz_search_t

2 years agouse dns_qp_getname() where possible
Evan Hunt [Thu, 11 Apr 2024 17:00:22 +0000 (10:00 -0700)] 
use dns_qp_getname() where possible

some calls to dns_qp_lookup() do not need partial matches, QP chains
or QP iterators. in these cases it's more efficient to use
dns_qp_getname().

2 years agoget foundname from the node
Evan Hunt [Thu, 11 Apr 2024 03:48:24 +0000 (23:48 -0400)] 
get foundname from the node

when calling dns_qp_lookup() from qpcache, instead of passing
'foundname' so that a name would be constructed from the QP key,
we now just use the name field in the node data. this makes
dns_qp_lookup() run faster.

the same optimization has also been added to qpzone.

the documentation for dns_qp_lookup() has been updated to
discuss this performance consideration.

2 years agoinclude the nodenames when calculating memory to purge
Evan Hunt [Thu, 14 Mar 2024 23:46:52 +0000 (16:46 -0700)] 
include the nodenames when calculating memory to purge

when the cache is over memory, we purge from the LRU list until
we've freed the approximate amount of memory to be added. this
approximation could fail because the memory allocated for nodenames
wasn't being counted.

add a dns_name_size() function so we can look up the size of nodenames,
then add that to the purgesize calculation.

2 years agosimplify qpcache iterators
Evan Hunt [Wed, 13 Mar 2024 05:19:47 +0000 (22:19 -0700)] 
simplify qpcache iterators

in a cache database, unlike zones, NSEC3 records are stored in
the main tree. it is not necessary to maintain a separate 'nsec3'
tree, nor to have code in the dbiterator implementation to traverse
from one tree to another.

(if we ever implement synth-from-dnssec using NSEC3 records, we'll
need to revert this change. in the meantime, simpler code is better.)

2 years agoclean up unnecessary dbiterator code related to origin
Evan Hunt [Mon, 29 Apr 2024 21:57:42 +0000 (14:57 -0700)] 
clean up unnecessary dbiterator code related to origin

the QP database doesn't support relative names as the RBTDB did, so
there's no need for a 'new_origin' flag or to handle `DNS_R_NEWORIGIN`
result codes.

2 years agomore cleanups in qpcache.c
Evan Hunt [Tue, 12 Mar 2024 08:05:07 +0000 (01:05 -0700)] 
more cleanups in qpcache.c

- remove unneeded struct members and misleading comments.
- remove unused parameters for static functions.
- rename 'find_callback' to 'delegating' for consistency with qpzone;
  the find callback mechanism is not used in QP databases.

2 years agorename QPDB_HEADERNODE to HEADERNODE
Evan Hunt [Mon, 29 Apr 2024 22:54:37 +0000 (15:54 -0700)] 
rename QPDB_HEADERNODE to HEADERNODE

this makes the macro consistent between qpcache.c and qpzone.c.

also removed a redundant definition of HEADERNODE in qpzone.c.

2 years agofix structure names in qpcache.c and qpzone.c
Evan Hunt [Mon, 29 Apr 2024 22:29:33 +0000 (15:29 -0700)] 
fix structure names in qpcache.c and qpzone.c

- change dns_qpdata_t to qpcnode_t (QP cache node), and dns_qpdb_t to
  qpcache_t, as these types are only accessed locally.
- also change qpdata_t in qpzone.c to qpznode_t (QP zone node), for
  consistency.
- make the refcount declarations for qpcnode_t and qpznode_t static,
  using the new ISC_REFCOUNT_STATIC macros.

2 years agoclean up unnecessary requirements in qpcache.c
Evan Hunt [Mon, 29 Apr 2024 22:09:43 +0000 (15:09 -0700)] 
clean up unnecessary requirements in qpcache.c

qpcache can only support cache semantics now, so there's
no longer any need to check for that internally.

2 years agoadd static macros for ISC_REFCOUNT_DECL/IMPL
Evan Hunt [Tue, 12 Mar 2024 08:02:48 +0000 (01:02 -0700)] 
add static macros for ISC_REFCOUNT_DECL/IMPL

this commit adds a mechanism to statically declare attach/detach
and ref/unref methods, for objects that are only accessed within
a single C file.

2 years agoMerge branch 'ondrej/improve-newref-checks' into 'main'
Ondřej Surý [Tue, 30 Apr 2024 18:43:39 +0000 (18:43 +0000)] 
Merge branch 'ondrej/improve-newref-checks' into 'main'

Improve the reference counting in newref()

See merge request isc-projects/bind9!8914

2 years agoImprove the reference counting checks in newref()
Ondřej Surý [Tue, 26 Mar 2024 13:13:24 +0000 (14:13 +0100)] 
Improve the reference counting checks in newref()

In qpcache (and rbtdb), there are some functions that acquire
neither the tree lock nor the node lock when calling newref().
In theory, this could lead to a race in which a new reference
is added to a node that was about to be deleted.

We now detect this condition by passing the current tree and node
lock status to newref(). If the node was previously unreferenced
and we don't hold at least one read lock, we will assert.

2 years agoMerge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'
Michal Nowak [Mon, 29 Apr 2024 18:10:52 +0000 (18:10 +0000)] 
Merge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'

Use FreeBSD autoscaler for "stress" tests

See merge request isc-projects/bind9!8968

2 years agoUse FreeBSD autoscaler for "stress" tests
Michal Nowak [Thu, 4 Apr 2024 10:59:50 +0000 (12:59 +0200)] 
Use FreeBSD autoscaler for "stress" tests

The FreeBSD autoscaler has been configured to utilize the new "instance"
GitLab Runner executor to spawn "stress" test CI jobs on AWS EC2
dynamically. A shared GitLab Runner named "freebsd-instance-autoscaler"
has been set up in GitLab CI/CD to communicate with EC2, provisioning VM
instances on demand based on a FreeBSD 13 AMI image. This image is the
same as the one previously used for FreeBSD "stress" tests before the
implementation of autoscaling (specifically, the
"freebsd13-amd64-bind9stress.aws.lab.isc.org" GitLab Runner in CI/CD).

2 years agoMerge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'
Michał Kępień [Mon, 29 Apr 2024 09:48:06 +0000 (09:48 +0000)] 
Merge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'

Update URLs and paths for the BIND 9 QA repository

See merge request isc-projects/bind9!8990

2 years agoUpdate URLs and paths for the BIND 9 QA repository
Michał Kępień [Fri, 26 Apr 2024 16:43:07 +0000 (18:43 +0200)] 
Update URLs and paths for the BIND 9 QA repository

Since the BIND 9 QA repository has been made public, adjust the relevant
URLs and paths used in .gitlab-ci.yml so that they work with the public
version of that repository.

2 years agoMerge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'
Aydın Mercan [Fri, 26 Apr 2024 15:47:46 +0000 (15:47 +0000)] 
Merge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'

Emit and read correct DoT and DoH dnstap entries

Closes #4523

See merge request isc-projects/bind9!8697

2 years agoAdd CHANGES and release note for [GL #4523]
Aydın Mercan [Tue, 6 Feb 2024 12:28:12 +0000 (15:28 +0300)] 
Add CHANGES and release note for [GL #4523]

2 years agoProvide an early escape hatch for ns_client_transport_type
Aydın Mercan [Thu, 15 Feb 2024 10:30:42 +0000 (13:30 +0300)] 
Provide an early escape hatch for ns_client_transport_type

Because some tests don't have a legtimate handle, provide a temporary
return early that should be fixed and removed before squashing. This
short circuiting is still correct until DoQ/DoH3 support is introduced.

2 years agoAdd fallback to ns_client_get_type despite unreachable
Aydın Mercan [Wed, 7 Feb 2024 08:35:59 +0000 (11:35 +0300)] 
Add fallback to ns_client_get_type despite unreachable

GCC might fail to compile because it expects a return after UNREACHABLE.
It should ideally just work anyway since UNREACHABLE is either a
noreturn or UB (__builtin_unreachable / C23 unreachable).

Either way, it should be optimized almost always so the fallback is
free or basically free anyway when it isn't optimized out.