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

75 Commits

Author SHA1 Message Date
Diego Fronza
7417b79c7a Added test for the proposed fix
Added test to ensure that NXDOMAIN is returned when BIND is queried for a
non existing domain in CH class (if a view of CHAOS class is configured)
and that it also doesn't crash anymore in those cases.
2020-01-22 16:15:51 -03:00
Diego Fronza
994fc2e822 Improved prefetch disabled test code
Using retry_quiet to test that prefetch is disabled instead of a
standard loop with sleep 1 between each iteration.
2019-12-04 19:29:55 -03:00
Diego Fronza
a711d6f8c0 Fix resolver tests: prefetch 40/41
These two tests were failing basically because in order for prefetching to
happen, the TTL for a given DNS record must be greater than or equal to
the prefetch config value + 9.

The previous TTL for both records was 10, while prefetch value in
configuration was 3, thus making only records with TTL >= 12 elligible
for prefetching.

TTL value for both records was adjusted to the value 13, and prefetch
value was set to 4 (inc by 1), so records with TTL (4 + 9) >= 13 are
elligible for prefetching.

Adjusting prefetch value to 4 gives the test 1 second more to avoid time
problems when sharing resources on a heavy loaded PC.

Also prefetch value in settings is now read by the script and used
by it to corrrectly calculate the amount of time needed to delay before
sending a request to trigger prefetch, adding a bit of flexibility to
fine tune the test in the future.
2019-12-04 19:29:55 -03:00
Diego Fronza
dd524cc893 Fix resolver test: prefetch disabled
The previous test had two problems:
1. It wasn't written specifically for testing what it was supposed to:
prefetch disabled.
2. It could fail in some circunstances if the computer's load is too
high, due to sleeps not taking parallel tests and cpu load into account.

The new test is testing prefetch disabled as follows:
1. It asks for a txt record for a given domain and takes note of the
record's TTL (which is 10).
2. It sleeps for (TTL - 5) = 5 seconds, having a window of 5 seconds to
issue new queries before the record expires from cache.
3. Three(3) queries are executed in a row, with a interval of 1 second
between them, and for each query we verify that the TTL in response is
less than the previous one, thus ensuring that prefetch is disabled (if
it were enabled this record would have been refreshed already and TTL
would be >= the first TTL).

Having a window of 5 seconds to perform 3 queries with a interval of 1
second between them gives the test a reasonable amount of time
to not suffer from a machine with heavy load.
2019-12-04 19:29:54 -03:00
Evan Hunt
d484b66ae1 improve system tests
- increase prefetch test timing tolerance.
- remove five-second pause and explicit connection closing in tcp test
  as they are no longer necessary.
2019-11-22 16:46:32 -08:00
Mark Andrews
4a5400c1b7 use test specific shell variables 2019-09-26 03:30:43 -04:00
Mark Andrews
70dd93bf8a don't escape commas when saving named's command line 2019-08-29 20:16:33 -04:00
Mark Andrews
42ed7e43dc tests/resolver: look for hash algorithm 2 (SHA-256) now 2019-05-08 18:17:55 -07:00
Michał Kępień
b6cce0fb8b Do not rely on default dig options in system tests
Some system tests assume dig's default setings are in effect.  While
these defaults may only be silently overridden (because of specific
options set in /etc/resolv.conf) for BIND releases using liblwres for
parsing /etc/resolv.conf (i.e. BIND 9.11 and older), it is arguably
prudent to make sure that tests relying on specific +timeout and +tries
settings specify these explicitly in their dig invocations, in order to
prevent test failures from being triggered by any potential changes to
current defaults.
2019-04-03 12:57:33 +02:00
Michał Kępień
70ae48e5cb Fix IP regex used in the "resolver" system test
If dots are not escaped in the "1.2.3.4" regular expressions used for
checking whether IP address 1.2.3.4 is present in the tested resolver's
answers, a COOKIE that matches such a regular expression will trigger a
false positive for the "resolver" system test.  Properly escape dots in
the aforementioned regular expressions to prevent that from happening.
2019-03-01 01:32:54 -05:00
Witold Kręcicki
6d50138405 Use rndc_reload in tests, make sure that reload is complete before continuing 2018-12-19 11:33:37 +01:00
Witold Kręcicki
b5c9a8caad Set result to SERVFAIL if upstream responded with FORMERR
Commit ba912435427cf884fdc1ca26743eba6c00439106 causes the resolver to
respond to a client query with FORMERR when all upstream queries sent to
the servers authoritative for QNAME elicit FORMERR responses.  This
happens because resolver code returns DNS_R_FORMERR in such a case and
dns_result_torcode() acts as a pass-through for all arguments which are
already a valid RCODE.

The correct RCODE to set in the response returned to the client in the
case described above is SERVFAIL.  Make sure this happens by overriding
the RCODE in query_gotanswer(), on the grounds that any format errors in
the client query itself should be caught long before execution reaches
that point.  This change should not reduce query error logging accuracy
as the resolver code itself reports the exact reason for returning a
DNS_R_FORMERR result using log_formerr().
2018-10-23 13:50:27 +02:00
Michał Kępień
24b9ec555a Do not treat a referral with a non-empty ANSWER section as an error
As part of resquery_response() refactoring [1], a goto statement was
replaced [2] with a call to a new function - originally called
rctx_delegation(), now folded into rctx_answer_none() - extracted from
existing code.  However, one call site of that refactored function does
not reset the "result" variable, causing a referral with a non-empty
ANSWER section to be inadvertently treated as an error, which prevents
resolution of names reliant on servers sending such responses.  Fix by
resetting the "result" variable to ISC_R_SUCCESS when a response
containing a non-empty ANSWER section can be treated as a delegation.

[1] see RT #45362

[2] see commit e1380a16741a3b4a57e54d7a9ce09dd12691522f
2018-08-22 10:14:37 +02:00
Evan Hunt
3f907b8bee caclulate nlabels and set *chainingp correctly 2018-08-08 14:33:19 -07:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Evan Hunt
0c559199bf final cleanup
- add CHANGES note
- update copyrights and license headers
- add -j to the make commands in .gitlab-ci.yml to take
  advantage of parallelization in the gitlab CI process
2018-02-22 22:58:15 -08:00
Evan Hunt
c032c54dda parallelize most system tests 2018-02-22 15:29:02 -08:00
Evan Hunt
25b33bede4 [master] improve handling of qcount=0 replies
4717.	[bug]		Treat replies with QCOUNT=0 as truncated if TC=1,
			FORMERR if TC=0, and log the error correctly.
			[RT #45836]
2017-09-12 15:26:30 -07:00
Tinderbox User
b168f3f805 update copyright notice / whitespace 2017-05-02 23:45:36 +00:00
Mark Andrews
33e94f501f 4615. [bug] AD could be set on truncated answer with no records
present in the answer and authority sections.
                        [RT #45140]
2017-05-03 07:51:41 +10:00
Mark Andrews
def6b33bad 4534. [bug] Only set RD, RA and CD in QUERY responses. [RT #43879] 2016-12-13 16:27:18 +11:00
Mark Andrews
4914e3ddc6 number all resolver tests 2016-12-13 15:02:32 +11:00
Evan Hunt
5480a74b70 [master] simplify prereq checks by using feature-test.c
4498.	[test]		Simplify prerequisite checks in system tests.
			[RT #43516]
2016-10-31 16:53:37 -07:00
Witold Krecicki
358dfaee18 4487. [test] Make system tests work on Windows. [RT #42931] 2016-10-19 17:18:42 +02:00
Mark Andrews
e1f590a59a remove spurious 'i' 2016-08-26 13:41:57 +10:00
Mark Andrews
f431bf02a6 4453. [bug] Prefetching of DS records failed to update their
RRSIGs. [RT #42865]
2016-08-25 09:51:31 +10:00
Mark Andrews
0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Mark Andrews
3635d8f910 do not overflow exit status. [RT #42643] 2016-06-14 13:48:39 +10:00
Tinderbox User
27def92931 update copyright notice / whitespace 2016-03-21 23:45:22 +00:00
Mark Andrews
0993cd5f22 4336. [bug] Don't emit records with zero ttl unless the records
were learnt with a zero ttl. [RT #41687]
2016-03-21 13:22:21 +11:00
Mark Andrews
65d59a4307 4232. [test] Add tests for CDS and CDNSKEY with delegation-only.
[RT #40597]
2015-09-30 15:55:14 +10:00
Evan Hunt
1479200aa0 [master] DDoS mitigation features
3938.	[func]		Added quotas to be used in recursive resolvers
			that are under high query load for names in zones
			whose authoritative servers are nonresponsive or
			are experiencing a denial of service attack.

			- "fetches-per-server" limits the number of
			  simultaneous queries that can be sent to any
			  single authoritative server.  The configured
			  value is a starting point; it is automatically
			  adjusted downward if the server is partially or
			  completely non-responsive. The algorithm used to
			  adjust the quota can be configured via the
			  "fetch-quota-params" option.
			- "fetches-per-zone" limits the number of
			  simultaneous queries that can be sent for names
			  within a single domain.  (Note: Unlike
			  "fetches-per-server", this value is not
			  self-tuning.)
			- New stats counters have been added to count
			  queries spilled due to these quotas.

			See the ARM for details of these options. [RT #37125]
2015-07-08 22:53:39 -07:00
Mark Andrews
3e33f4198d 4154. [bug] A OPT record should be included with the FORMERR
response when there is a malformed EDNS option.
                        [RT #39647]

4153.   [bug]           Dig should zero non significant +subnet bits.  Check
                        that non significant ECS bits are zero on receipt.
                        [RT #39647]
2015-07-06 12:52:37 +10:00
Mark Andrews
ce67023ae3 4152. [func] Implement DNS COOKIE option. This replaces the
experimental SIT option of BIND 9.10.  The following
                        named.conf directives are avaliable: send-cookie,
                        cookie-secret, cookie-algorithm and nocookie-udp-size.
                        The following dig options are available:
                        +[no]cookie[=value] and +[no]badcookie.  [RT #39928]
2015-07-06 09:44:24 +10:00
Tinderbox User
0dfc0745c4 update copyright notice / whitespace 2015-05-21 23:45:26 +00:00
Mark Andrews
c7463967db 4119. [func] Allow dig to set the message opcode. [RT #39550] 2015-05-19 12:46:06 +10:00
Mark Andrews
ea3aa401bc 4015. [bug] Nameservers that are skipped due to them being
CNAMEs were not being logged. They are now logged
                        to category 'cname' as per BIND 8. [RT #37935]
2014-12-03 11:34:07 +11:00
Mark Andrews
947cf282a7 3949. [experimental] Experimental support for draft-andrews-edns1 by sending
EDNS(1) queries (define DRAFT_ANDREWS_EDNS1 when
                        building).  Add support for limiting the EDNS version
                        advertised to servers: server { edns-version 0; };
                        Log the EDNS version received in the query log.
                        [RT #35864]
2014-09-10 15:31:40 +10:00
Mark Andrews
3c13af3759 3892. [bug] Setting '-t aaaa' in .digrc had unintended side
effects. [RT #36452]
2014-07-08 02:00:28 +10:00
Mark Andrews
4694229f60 make a explict edns query so this subtest is independent of other tests 2014-05-29 10:46:44 +10:00
Mark Andrews
800d25b848 3863. [bug] The "E" flag was missing from the query log as a
unintended side effect of code rearrangement to
                        support EDNS EXPIRE. [RT #36117]
2014-05-29 08:04:55 +10:00
Mark Andrews
733898cffe use sub second sleeps for prefetch disabled test 2014-05-09 15:00:36 +10:00
Mark Andrews
b36fc8294e 3837. [security] A NULL pointer is passed to query_prefetch resulting
a REQUIRE assertion failure when a fetch is actually
                        initiated.  [ RT #35899]

Squashed commit of the following:

commit 7f4e1f3917d743089c42cc52ec2c0eea598d2c00
Author: Mukund Sivaraman <muks@isc.org>
Date:   Sun May 4 22:34:34 2014 +0530

    Fix a comment

commit 6a35a6a2346013fa8e3798b9b680d8a3031fcb03
Author: Mark Andrews <marka@isc.org>
Date:   Sun May 4 23:34:25 2014 +1000

    pass the correct name to query_prefetch
2014-05-05 10:12:12 +10:00
Tinderbox User
2cf1d5b098 update copyright notice 2014-01-12 23:46:23 +00:00
Mark Andrews
fb756ba304 3703. [func] Prefetch about to expire records if they are queried
for, see prefetch option for details. [RT #35041]
2014-01-12 21:29:15 +11:00
Evan Hunt
0606c47750 [master] correct dispatch address/port check
3690.	[bug]		Iterative responses could be missed when the source
			port for an upstream query was the same as the
			listener port (53). [RT #34925]
2013-12-12 22:39:12 -08:00
Evan Hunt
0618287859 [master] allow setting local addr in dns_client
3672.	[func]		Local address can now be specified when using
			dns_client API. [RT #34811]
2013-11-13 10:52:22 -08:00
Evan Hunt
b99bfa184b [master] unify internal and export libraries
3550.	[func]		Unified the internal and export versions of the
			BIND libraries, allowing external clients to use
			the same libraries as BIND. [RT #33131]
2013-04-10 13:49:57 -07:00
Tinderbox User
f9adb48aea update copyright notice 2013-04-03 23:46:07 +00:00
Mark Andrews
8013077aa7 3541. [bug] The parts if libdns was not being properly initialized
in when built in libexport mode. [RT #33028]
2013-04-03 17:27:40 +11:00