2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

41385 Commits

Author SHA1 Message Date
Ondřej Surý
3feabc8a22
Cleanup the dns_cache unit
Remove duplicate code and use ISC_REFCOUNT_{DECL,IMPL} macros.
2024-05-25 11:47:33 +02:00
Michal Nowak
08eef0fa0d Merge branch 'mnowak/cross-version-config-tests-drop-allow_failure-true' into 'main'
Drop "allow_failure: true" in cross-version-config-tests job

See merge request isc-projects/bind9!9044
2024-05-24 11:44:39 +00:00
Michal Nowak
c58dd6e78f
Workaround temporary cross-version-config-tests limitation
The system test from the BIND 9.19.24 release does not include the
isctest/vars/autoconf.py file from 9.19.25-dev, and therefore the job
will fail before the 9.19.25 release is published. In the meantime,
consider using the conf.sh file.
2024-05-24 11:01:40 +02:00
Nicki Křížek
e712cf613f
Fix oversight in cross-version-config test
This is a followup for 5e7b3d9ef36b199e2d24d385593a8e2f7d541b65. The
change slipped by during refactoring and this line wasn't updated.
2024-05-24 11:00:09 +02:00
Michal Nowak
8d99ce28e8
Revert "Allow failure of cross-version-config test"
This reverts commit b99cdfab9d012bce63dff8463eae87772034138a.
2024-05-24 10:59:27 +02:00
Ondřej Surý
7e87e2657a Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main'
Refactor the common buffer manipulation in rdataslab.c in macros

See merge request isc-projects/bind9!9063
2024-05-24 08:29:54 +00:00
Ondřej Surý
03ed19cf71
Refactor the common buffer manipulation in rdataslab.c in macros
The rdataslab.c was full of code like this:

        length = raw[0] * 256 + raw[1];

and

        count2 = *current2++ * 256;
        count2 += *current2++;

Refactor code like this into peek_uint16() and get_uint16 macros
to prevent code repetition and possible mistakes when copy and
pasting the same code over and over.

As a side note for an entertainment of a careful reader of the commit
messages: The byte manipulation was changed from multiplication and
addition to shift with or.

The difference in the assembly looks like this:

MUL and ADD:

	movzx   eax, BYTE PTR [rdi]
        movzx   edi, BYTE PTR [rdi+1]
        sal     eax, 8
        or      edi, eax

SHIFT and OR:

        movzx   edi, WORD PTR [rdi]
        rol     di, 8
        movzx   edi, di

If the result and/or buffer is then being used after the macro call,
there's more differences in favor of the SHIFT+OR solution.
2024-05-24 09:52:45 +02:00
Michal Nowak
c8289279f0 Merge branch 'mnowak/alpine-3.20' into 'main'
Add Alpine Linux 3.20

See merge request isc-projects/bind9!9059
2024-05-23 11:19:26 +00:00
Michal Nowak
6f22e79ef9
Add Alpine Linux 3.20 2024-05-23 10:58:25 +02:00
Michal Nowak
1f5143e066 Merge branch 'mnowak/short-stress-tests-should-keep-artifacts' into 'main'
Short stress tests should keep artifacts

See merge request isc-projects/bind9!9056
2024-05-22 10:55:18 +00:00
Michal Nowak
aa72747c80
Short stress tests should keep artifacts 2024-05-22 10:46:28 +02:00
Aydın Mercan
4de93e86fa Merge branch 'aydin/fix-trace' into 'main'
Fix typing mistakes in trace macros

See merge request isc-projects/bind9!9050
2024-05-20 11:45:22 +00:00
Aydın Mercan
03a59cbb04 reinsert accidentally removed + in db trace
It only affects development when using `DNS_DB_TRACE`.
2024-05-17 18:11:23 -07:00
Aydın Mercan
49e62ee186 fix typing mistakes in trace macros
The detach function declaration in `ISC__REFCOUNT_TRACE_DECL` had an
returned an accidental implicit int. While not allowed since C99, it
became an error by default in GCC 14.

`ISC_REFCOUNT_TRACE_IMPL` and `ISC_REFCOUNT_STATIC_TRACE_IMPL` expanded
into the wrong macros, trying to declare it again with the wrong number
of parameters.
2024-05-17 18:11:23 -07:00
Evan Hunt
5972a80714 Merge branch '4730-clang-format-header-file-changes' into 'main'
Resolve "Clang format header file changes"

Closes #4730

See merge request isc-projects/bind9!9047
2024-05-17 23:18:47 +00:00
Mark Andrews
1697011af6 Ignore reformat sources with up-to-date clang-format-18 2024-05-17 16:03:46 -07:00
Mark Andrews
b7de2c7cb9 Clang-format header file changes 2024-05-17 16:03:21 -07:00
Arаm Sаrgsyаn
add3a6ee8c Merge branch 'aram/mr8937-changes-placeholder' into 'main'
Add a CHANGES placeholder for [GL !8937]

See merge request isc-projects/bind9!9049
2024-05-17 10:48:23 +00:00
Aram Sargsyan
563ed741bf Add a CHANGES placeholder for [GL !8937] 2024-05-17 10:20:48 +00:00
Mark Andrews
8246465513 Merge branch '4726-increase-formerr-coverage-in-message-parsing' into 'main'
Resolve "Increase FORMERR coverage in message parsing"

Closes #4726

See merge request isc-projects/bind9!9034
2024-05-17 05:16:48 +00:00
Mark Andrews
6e9ed4983e add test cases for several FORMERR code paths:
- duplicated question
  - duplicated answer
  - qtype as an answer
  - two question types
  - question names
  - nsec3 bad owner name
  - short record
  - short question
  - mismatching question class
  - bad record owner name
  - mismatched class in record
  - mismatched KEY class
  - OPT wrong owner name
  - invalid RRSIG "covers" type
  - UPDATE malformed delete type
  - TSIG wrong class
  - TSIG not the last record
2024-05-17 13:39:22 +10:00
Evan Hunt
6a9ac65f0c Merge branch '4683-qpzone-tsan-fix' into 'main'
replace qpzone node attributes with atomics

Closes #4683

See merge request isc-projects/bind9!9033
2024-05-17 00:33:48 +00:00
Evan Hunt
9c882f1e69 replace qpzone node attriutes with atomics
there were TSAN error reports because of conflicting uses of
node->dirty and node->nsec, which were in the same qword.

this could be resolved by separating them, but we could also
make them into atomic values and remove some node locking.
2024-05-17 00:33:35 +00:00
Matthijs Mekking
bcc6039bf5 Merge branch 'matthijs-qp-set-iterator' into 'main'
Rewrite fix_iterator()

See merge request isc-projects/bind9!9038
2024-05-16 09:50:08 +00:00
Matthijs Mekking
82e9d93c0b Two more qp test cases
Add two more cases that should select different predecessors from
different twigs.
2024-05-16 09:49:41 +00:00
Matthijs Mekking
f882101265 Rewrite qp fix_iterator()
The fix_iterator() function had a lot of bugs in it and while fixing
them, the number of corner cases and the complexity of the function
got out of hand. Rewrite the function with the following modifications:

The function now requires that the iterator is pointing to a leaf node.
This removes the cases we have to deal when the iterator was left on a
dead branch.

From the leaf node, pop up the iterator stack until we encounter the
branch where the offset point is before the point where the search key
differs. This will bring us to the right branch, or at the first
unmatched node, in which case we pop up to the parent branch. From
there it is easier to retrieve the predecessor.

Once we are at the right branch, all we have to do is find the right
twig (which is either the twig for the character at the position where
the search key differs, or the previous twig) and walk down from there
to the greatest leaf or, in case there is no good twig, get the
previous twig from the successor and get the greatest leaf from there.

If there is no previous twig to select in this branch, because every
leaf from this branch node is greater than the one we wanted, we need
to pop up the stack again and resume at the parent branch. This is
achieved by calling prevleaf().
2024-05-16 09:49:41 +00:00
Matthijs Mekking
8b8c16d7a4 Get anyleaf when qp lookup is on a dead end branch
Move the fix_iterator out of the loop and only call it when we found
a leaf node. This leaf node may be the wrong leaf node, but fix_iterator
should correct that.

Also, when we don't need to set the iterator, just get any leaf. We
only need to have a leaf for the qpkey_compare and the end result does
not matter if compare was against an ancestor leaf or any leaf below
that point.
2024-05-16 09:49:41 +00:00
Michal Nowak
6b89d66ce8 Merge tag 'v9.19.24' 2024-05-16 11:37:12 +02:00
Mark Andrews
ed5b9b0898 Merge branch '4517-dnssec-verify-reports-errors-in-nsec3-chain' into 'main'
Resolve "dnssec-verify reports errors in NSEC3 chain"

Closes #4517

See merge request isc-projects/bind9!8631
2024-05-16 01:52:55 +00:00
Mark Andrews
e4dbf4be8e Add CHANGES note for [GL #4517] 2024-05-16 10:28:27 +10:00
Mark Andrews
dd13f41ae1 Don't sign non-apex DNSKEY records
DNSKEY can only be validated if it is signed by itself.  Stop
attempting to sign non apex DNSKEY RRsets.
2024-05-16 10:28:27 +10:00
Mark Andrews
315ad2df7a Remove invalid DNSKEY RRset from zone 2024-05-16 10:28:27 +10:00
Mark Andrews
122111f75e Add regression test data for [GL #4517]
An obscured DNSKEY RRset at a delegation was incorrectly added to
the NSEC/NSEC3 type bit map leading to zone verification failures.
This adds such a RRset to the test zone.
2024-05-16 10:28:27 +10:00
Mark Andrews
b3efc15be4 Fail if there are non apex DNSKEYs
DNSSEC only works when DNSKEYs are self signed.  This only occurs
when the DNSKEY RRset is at the apex.  Cause dnssec-signzone to
fail if it attempts to sign an non-apex DNSKEY RRset.
2024-05-16 10:28:27 +10:00
Mark Andrews
ec3c624814 Properly build the NSEC/NSEC3 type bit map
DNSKEY was incorrectly being added to the NESC/NSEC3 type bit map
when it was obscured by the delegation.  This lead to zone verification
failures.
2024-05-16 10:27:49 +10:00
Mark Andrews
e84615629f Properly update 'maxtype'
'maxtype' should be checked to see if it should be updated whenever
a type is added to the type map.
2024-05-16 10:20:49 +10:00
Ondřej Surý
333d1881f9 Merge branch 'ondrej/isc_httpd-reference-counting' into 'main'
Properly attach/detach isc_httpd in case read ends earlier than send

See merge request isc-projects/bind9!9037
2024-05-15 12:32:15 +00:00
Ondřej Surý
eb862ce509
Properly attach/detach isc_httpd in case read ends earlier than send
An assertion failure would be triggered when sending the TCP data ends
after the TCP reading gets closed.  Implement proper reference counting
for the isc_httpd object.
2024-05-15 12:22:10 +02:00
Michał Kępień
5fd3530741 Merge branch '4719-placeholder' into 'main'
Add placeholder for GL #4719

See merge request isc-projects/bind9!9036
2024-05-15 08:21:55 +00:00
Michał Kępień
ea6032146c
Add placeholder for GL #4719 2024-05-15 10:20:19 +02:00
Evan Hunt
0748847400 Merge branch '4717-qp-lookup-creates-incorrect-chain' into 'main'
Fix dns_qp_lookup() chain inconsistency after fix_iterator()

Closes #4717

See merge request isc-projects/bind9!9028
2024-05-14 20:36:11 +00:00
Matthijs Mekking
730e532cac Test check_predecessors with chain
In addition to testing check_qpchain in combination with qpiter,
test check_predecessors in combination with a qpchain.
2024-05-14 12:58:46 -07:00
Evan Hunt
b6815de316 Fix QP chain on partial match
When searching for a requested name in dns_qp_lookup(), we may add
a leaf node to the QP chain, then subsequently determine that the
branch we were on was a dead end. When that happens, the chain can be
left holding a pointer to a node that is *not* an ancestor of the
requested name.

We correct for this by unwinding any chain links with an offset
value greater or equal to that of the node we found.
2024-05-14 12:58:46 -07:00
Petr Špaček
5d96f11693 Unit test to demonstrate issue #4717
Iterator in lookup() call must be non-NULL to trigger the issue.
Run chain tests twice, once without iterator and second time with
iterator.
2024-05-14 12:58:46 -07:00
Matthijs Mekking
91de4f6490 Refactor fix_iterator
The code below the if/else construction could only be run if the 'if'
code path was taken. Move the code into the 'if' code block so that
it is more easier to read.
2024-05-14 12:58:46 -07:00
Nicki Křížek
ac569ad544 Merge branch 'nicki/add-mailmap' into 'main'
Add .mailmap to the git repo

See merge request isc-projects/bind9!9025
2024-05-14 11:28:00 +00:00
Nicki Křížek
986013a708
Add .mailmap to the git repo
Mailmap can be used to unify the display name in standard git tools.
2024-05-14 13:05:45 +02:00
Michal Nowak
d9fbbd537d Merge branch 'mnowak/pytest_rewrite_include-multiplecfg' into 'main'
Rewrite include-multiplecfg system test to pytest

See merge request isc-projects/bind9!8806
2024-05-14 10:46:10 +00:00
Michal Nowak
e9e8753306
Rewrite include-multiplecfg system test to pytest 2024-05-14 11:45:55 +02:00
Michal Nowak
77a42f8875
Use isctest.run.cmd() helper function in tests 2024-05-14 11:45:55 +02:00