2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 09:05:40 +00:00
Commit Graph

32968 Commits

Author SHA1 Message Date
Mark Andrews
1f63bb15b3 Restore the dns_message_reset() call before the dns_dispatch_getnext()
This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.
2020-10-08 10:55:35 +11:00
Matthijs Mekking
372142d371 Merge branch 'matthijs-kasp-test-requires-python' into 'main'
The kasp system test requires Python

See merge request isc-projects/bind9!4241
2020-10-07 15:22:23 +00:00
Matthijs Mekking
fedd621f37 The kasp system test requires Python
Only run the kasp system test if HAVE_PYTHON.
2020-10-07 10:21:43 +00:00
Mark Andrews
a3892cf783 Merge branch 'marka-wait-for-isc_nm_stoplistening' into 'main'
Wait for isc_nm_stoplistening() to complete

See merge request isc-projects/bind9!4217
2020-10-07 08:15:44 +00:00
Mark Andrews
402ac79833 Fix the data race on shutdown/reconfig in control channel
The controllistener could be freed before the event posted by
isc_nm_stoplistening() has been processed. This commit adds
a reference counter to the controllistener to determine when
to free the listener.
2020-10-07 18:24:25 +11:00
Mark Andrews
08c996c80a Merge branch '2200-the-fuzzer-dns_message_parser-c-is-leaking-memory' into 'main'
Resolve "The fuzzer dns_message_parse.c is leaking memory."

Closes #2200

See merge request isc-projects/bind9!4239
2020-10-06 13:20:36 +00:00
Mark Andrews
0d978878c5 invalidate cctx on error 2020-10-06 23:50:01 +11:00
Mark Andrews
40e54142f8 Merge branch 'marka-create_query-fix-REVERSE_INULL' into 'main'
Silence Coverity REVERSE_INULL report

Closes #2198

See merge request isc-projects/bind9!4234
2020-10-06 12:33:56 +00:00
Mark Andrews
f0a66cb5aa Silence Coverity REVERSE_INULL report
message does not need to be tested to NULL
2020-10-06 12:11:25 +00:00
Matthijs Mekking
d2d7f2a14e Merge branch 'he32-test-fix' into 'main'
Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4235
2020-10-06 08:28:12 +00:00
Havard Eidnes
1f83daa4ac Avoid a non-standard bashism: use of "==" in "test". 2020-10-06 08:27:56 +00:00
Mark Andrews
4134980448 Merge branch 'marka-render_buf-was-too-big' into 'main'
render_buf was too big

See merge request isc-projects/bind9!4231
2020-10-06 07:37:30 +00:00
Mark Andrews
8faf12eace render buf was too big
It was misdeclared as a array of pointers (uint8_t*[]) and there
where too many elements (64 * 1024) instead of (64 * 1024 - 1).
2020-10-06 09:49:28 +11:00
Ondřej Surý
50df71a881 Merge branch '2183-dns-flag-day-2020' into 'main'
Resolve "DNS Flag Day 2020"

Closes #2183

See merge request isc-projects/bind9!4179
2020-10-05 15:13:12 +00:00
Ondřej Surý
096d41b4e2 Add text describing the changes done in the MR in more detail 2020-10-05 16:21:21 +02:00
Ondřej Surý
b9a42446e8 Enable DF (don't fragment) flag on listening UDP sockets
This commits uses the isc__nm_socket_dontfrag() helper function to
enable setting DF bit on the outgoing UDP packets.
2020-10-05 16:21:21 +02:00
Ondřej Surý
63c29dcdfa Change the default EDNS buffer size for dig, mdig and host to 1232
The dig should behave closely to how the resolver code in `named` work,
so we need to change the buffer size in dig, mdig and host too.
2020-10-05 16:21:21 +02:00
Ondřej Surý
f1556f8c41 Adjust legacy and digdelv tests for default 1232 EDNS Buffer Size
* the legacy test with -T maxudp512 will just fail, e.g. if the packets
  larger than 512 octets are dropped along the path, the proper response
  is to fail

* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment
2020-10-05 16:21:21 +02:00
Ondřej Surý
bb990030d3 Simplify the EDNS buffer size logic for DNS Flag Day 2020
The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the required
changes and simplify the logic for picking the EDNS Buffer Size.

1. The defaults for `edns-udp-size`, `max-udp-size` and
   `nocookie-udp-size` have been changed to `1232` (the value picked by
   DNS Flag Day 2020).

2. The probing heuristics that would try 512->4096->1432->1232 buffer
   sizes has been removed and the resolver will always use just the
   `edns-udp-size` value.

3. Instead of just disabling the PMTUD mechanism on the UDP sockets, we
   now set IP_DONTFRAG (IPV6_DONTFRAG) flag.  That means that the UDP
   packets won't get ever fragmented.  If the ICMP packets are lost the
   UDP will just timeout and eventually be retried over TCP.
2020-10-05 16:21:21 +02:00
Ondřej Surý
d51f09a8d0 Merge branch 'ondrej/refactor-setsockopt' into 'main'
Refactor the setsockopt() code in network manager into helper functions

See merge request isc-projects/bind9!4227
2020-10-05 14:11:55 +00:00
Ondřej Surý
fd975a551d Split reusing the addr/port and load-balancing socket options
The SO_REUSEADDR, SO_REUSEPORT and SO_REUSEPORT_LB has different meaning
on different platform. In this commit, we split the function to set the
reuse of address/port and setting the load-balancing into separate
functions.

The libuv library already have multiplatform support for setting
SO_REUSEADDR and SO_REUSEPORT that allows binding to the same address
and port, but unfortunately, when used after the load-balancing socket
options have been already set, it overrides the previous setting, so we
need our own helper function to enable the SO_REUSEADDR/SO_REUSEPORT
first and then enable the load-balancing socket option.
2020-10-05 15:18:28 +02:00
Ondřej Surý
acb6ad9e3c Use uv_os_sock_t instead of uv_os_fd_t for sockets
On POSIX based systems both uv_os_sock_t and uv_os_fd_t are both typedef
to int.  That's not true on Windows, where uv_os_sock_t is SOCKET and
uv_os_fd_t is HANDLE and they differ in level of indirection.
2020-10-05 15:18:28 +02:00
Ondřej Surý
9dc01a636b Refactor isc__nm_socket_freebind() to take fd and sa_family as args
The isc__nm_socket_freebind() has been refactored to match other
isc__nm_socket_...() helper functions and take uv_os_fd_t and
sa_family_t as function arguments.
2020-10-05 15:18:24 +02:00
Ondřej Surý
d685bbc822 Add helper function to enable DF (don't fragment) flag on UDP sockets
This commits add isc__nm_socket_dontfrag() helper functions.
2020-10-05 14:55:20 +02:00
Ondřej Surý
5daaca7146 Add SO_REUSEPORT and SO_INCOMING_CPU helper functions
The setting of SO_REUSE**** and SO_INCOMING_CPU have been moved into a
separate helper functions.
2020-10-05 14:54:24 +02:00
Matthijs Mekking
1567524a4f Merge branch '1749-rndc-dnssec-rollover' into 'main'
Resolve "rndc trigger rollover"

Closes #1749

See merge request isc-projects/bind9!4004
2020-10-05 09:46:48 +00:00
Matthijs Mekking
78c09f5622 Use default algorithm in kasp test if possible
These tests don't require a specific algorithm so they should use
the DEFAULT_ALGORITHM from 'conf.sh.common'.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
70d1ec432f Use explicit result codes for 'rndc dnssec' cmd
It is better to add new result codes than to overload existing codes.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
edc53fc416 Various rndc dnssec -checkds fixes
While working on 'rndc dnssec -rollover' I noticed the following
(small) issues:

- The key files where updated with hints set to "-when" and that
  should always be "now.
- The kasp system test did not properly update the test number when
  calling 'rndc dnssec -checkds' (and ensuring that works).
- There was a missing ']' in the rndc.c help output.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
fcd34abb9e Test rndc rollover inactive key
When users (accidentally) try to roll an inactive key, throw an error.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
e826facadb Add rndc dnssec -rollover command
This command is similar in arguments as -checkds so refactor the
'named_server_dnssec' function accordingly.  The only difference
are that:

- It does not take a "publish" or "withdrawn" argument.
- It requires the key id to be set (add a check to make sure).

Add tests that will trigger rollover immediately and one that
schedules a test in the future.
2020-10-05 10:53:45 +02:00
Matthijs Mekking
df8276aef0 Add manual key rollover logic
Add to the keymgr a function that will schedule a rollover. This
basically means setting the time when the key needs to retire,
and updating the key lifetime, then update the state file. The next
time that named runs the keymgr the new lifetime will be taken into
account.
2020-10-05 10:52:19 +02:00
Matthijs Mekking
b7c9a80dbe Merge branch '1870-fix-after-backport-to-9_11_s' into 'main'
Change condition for rndc dumpdb -expired

See merge request isc-projects/bind9!4219
2020-10-05 08:47:07 +00:00
Matthijs Mekking
5614454c3b Change condition for rndc dumpdb -expired
After backporting #1870 to 9.11-S I saw that the condition check there
is different than in the main branch. In 9.11-S "stale" can mean
stale and serve-stale, or not active (awaiting cleanup). In 9.16 and
later versions, "stale" is stale and serve-stale, and "ancient" means
not active (awaiting cleanup). An "ancient" RRset is one that is not
active (TTL expired) and is not eligble for serve-stale.

Update the condition for rndc dumpdb -expired to closer match what is
in 9.11-S.
2020-10-05 10:44:50 +02:00
Matthijs Mekking
45e68016d0 Merge branch '2171-dnssec-policy-weird-algo-15-bug' into 'main'
Resolve "dnssec-policy behaviour for algorithm 15 keys different to algorithm 8 keys"

Closes #2171

See merge request isc-projects/bind9!4199
2020-10-02 08:06:45 +00:00
Matthijs Mekking
af3b014976 Fix a timing issue in kasp system test
Sometimes, not all keys have been created in time before 'check_keys'
is called. Run a 'retry_quiet' on checking the number of keys before
continuing checking the key data.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
7c555254fe Fix kasp min key size bug
The minimal size for RSASHA1, RSASHA256 is 512, but due to bad
assignment it was set to 1024.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
621093fe69 Test migration to dnssec-policy with views
This test case is unrelated to the fix for #2171 but was added to
reproduce the problem.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
43c6806779 Minor fix in kasp system test
The 'wait_for_nsec' does not need to add TSIG because it calls
'dig_with_opts' and that already checks for TSIG.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
d6d41e96a3 Add change and note for #2171
This is a bug that needs to be noted.
2020-10-02 09:20:39 +02:00
Matthijs Mekking
0e207392ec Fix Ed25519 and Ed448 in dnssec-policy keymgr
The kasp code had bad implicit size values for the cryptographic
algorithms Ed25519 and Ed448. When creating keys they would never
match the dnssec-policy, leading to new attempts to create keys.

These algorithms were previously not yet added to the system tests,
due to lack of availability on some systems.
2020-10-02 09:20:19 +02:00
Matthijs Mekking
7be1835795 Add kasp tests for Ed25519 and Ed448
Use the testcrypto script to see if these algorithms are supported by
openssl. If so, add the specific configuration to the named.conf file
and touch a file to indicate support. If the file exists, the
corresponding setup and tests are performed.
2020-10-02 09:20:19 +02:00
Michał Kępień
e620f3a3ab Merge branch '2139-rrset-order-fixes-and-cleanups' into 'main'
"rrset-order" fixes and cleanups

Closes #2139

See merge request isc-projects/bind9!4195
2020-10-02 06:50:02 +00:00
Michał Kępień
27c815a220 Add CHANGES entries 2020-10-02 08:41:43 +02:00
Michał Kępień
2ac04dc930 Rework "rrset-order" documentation
Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.
2020-10-02 08:41:43 +02:00
Michał Kępień
abdd4c89fc Add tests for "order none" RRset ordering rules
Make sure "order none" RRset ordering rules are tested in the
"rrsetorder" system test just like all other rule types are.  As the
check for the case of no "rrset-order" rule matching a given RRset also
tests "order none" (rather than "order random", as the test code may
suggest at first glance), replace the test code for that case so that it
matches other "order none" tests.
2020-10-02 08:41:43 +02:00
Michał Kępień
dbcf683c1a Allow "order none" in "rrset-order" rules
named-checkconf treats the following configuration as valid:

    options {
        rrset-order {
            order none;
        };
    };

Yet, the above configuration causes named to crash on startup with:

    order.c:74: REQUIRE(mode == 0x00000800 || mode == 0x00000400 || mode == 0x00800000) failed, back trace

Add DNS_RDATASETATTR_NONE to the list of RRset ordering modes accepted
by dns_order_add() to allow "order none" to be used in "rrset-order"
rules.  This both prevents the aforementioned crashes and addresses the
discrepancy between named-checkconf and named.
2020-10-02 08:41:43 +02:00
Mark Andrews
b154abd393 Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime' into 'main'
Resolve "Allow task_test and rdata_tests subtests to be selected at runtime."

Closes #2112

See merge request isc-projects/bind9!4059
2020-10-01 12:46:00 +00:00
Mark Andrews
6293682020 Add the ability select individual tests to rdata_test 2020-10-01 08:21:42 +00:00
Mark Andrews
a9c3374717 Add the ability to print out the list of test names (-l) 2020-10-01 08:21:42 +00:00