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

120 Commits

Author SHA1 Message Date
Ondřej Surý
89b269b0d2 Add RUNTIME_CHECK() around result = dns_name_copy(..., NULL) calls
This second commit uses second semantic patch to replace the calls to
dns_name_copy() with NULL as third argument where the result was stored in a
isc_result_t variable.  As the dns_name_copy(..., NULL) cannot fail gracefully
when the third argument is NULL, it was just a bunch of dead code.

Couple of manual tweaks (removing dead labels and unused variables) were
manually applied on top of the semantic patch.
2019-10-01 10:43:26 +10:00
Ondřej Surý
4957255d13 Use the semantic patch to change the usage isc_mem_create() to new API 2019-09-12 09:26:09 +02:00
Ondřej Surý
50e109d659 isc_event_allocate() cannot fail, remove the fail handling blocks
isc_event_allocate() calls isc_mem_get() to allocate the event structure.  As
isc_mem_get() cannot fail softly (e.g. it never returns NULL), the
isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL)
handling blocks using the semantic patch from the previous commit.
2019-08-30 08:55:34 +02:00
Evan Hunt
a73350a210 remove DLV from dns_client API and lib/samples 2019-08-09 09:18:02 -07:00
Ondřej Surý
4db3189de2 Have the dns_client hold a .references until all external references are removed
so that cleanup can all be done in dns_client_destroy().

(cherry picked from commit e80c4c3431504a462ce03bffbb9229b9b34395d1)
(cherry picked from commit ebc48cda26ff3935406f48bb745561cc00fed046)
2019-08-07 12:43:13 +02:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Ondřej Surý
eb8c9bdd55 Make lib/isc/app.c opaque and thread-safe
This work cleans up the API which includes couple of things:

1. Make the isc_appctx_t type fully opaque

2. Protect all access to the isc_app_t members via stdatomics

3. sigwait() is part of POSIX.1, remove dead non-sigwait code

4. Remove unused code: isc_appctx_set{taskmgr,sockmgr,timermgr}
2019-05-20 18:13:02 +02:00
Mark Andrews
32ba5a0494 fix whitespace 2019-05-07 10:05:25 +10:00
Mark Andrews
127333c71f return rdatasets when processing ANY queries in client_resfind 2019-05-07 10:05:25 +10:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Michał Kępień
ada6846a10 Make delv use OS-supplied ephemeral port range
Make delv honor the operating system's preferred ephemeral port range
instead of always using the default 1024-65535 range for outgoing
messages.
2019-03-08 13:13:32 +01:00
Witold Kręcicki
d5793ecca2 - isc_task_create_bound - create a task bound to specific task queue
If we know that we'll have a task pool doing specific thing it's better
  to use this knowledge and bind tasks to task queues, this behaves better
  than randomly choosing the task queue.

- use bound resolver tasks - we have a pool of tasks doing resolutions,
  we can spread the load evenly using isc_task_create_bound

- quantum set universally to 25
2018-11-23 04:34:02 -05:00
Witold Kręcicki
929ea7c2c4 - Make isc_mutex_destroy return void
- Make isc_mutexblock_init/destroy return void
- Minor cleanups
2018-11-22 11:52:08 +00:00
Ondřej Surý
2f3eee5a4f isc_mutex_init returns 'void' 2018-11-22 11:51:49 +00:00
Ondřej Surý
23fff6c569 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
Ondřej Surý
b2b43fd235 Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 12:21:53 +07:00
Witold Kręcicki
9a903789ed Use larger quantum for network tasks 2018-11-06 08:19:50 +00:00
Ondřej Surý
994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Ondřej Surý
3a4f820d62 Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API.
The three functions has been modeled after the arc4random family of
functions, and they will always return random bytes.

The isc_random family of functions internally use these CSPRNG (if available):

1. getrandom() libc call (might be available on Linux and Solaris)
2. SYS_getrandom syscall (might be available on Linux, detected at runtime)
3. arc4random(), arc4random_buf() and arc4random_uniform() (available on BSDs and Mac OS X)
4. crypto library function:
4a. RAND_bytes in case OpenSSL
4b. pkcs_C_GenerateRandom() in case PKCS#11 library
2018-05-16 09:54:35 +02:00
Michał Kępień
4df4a8e731 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
2018-04-09 12:14:16 +02:00
Witold Kręcicki
102a397e39 libdns refactoring: get rid of multiple versions of dns_keytable_add, dns_iptable_addprefix and dns_iptable_addprefix 2018-04-06 08:04:41 +02:00
Witold Kręcicki
d54d482af0 libdns refactoring: get rid of multiple versions of dns_view_find, dns_view_findzonecut and dns_view_flushcache 2018-04-06 08:04:41 +02:00
Witold Kręcicki
42ee8c853a libdns refactoring: get rid of 3 versions of dns_resolver_createfetch 2018-04-06 08:04:41 +02:00
Witold Kręcicki
8c12e488f7 libdns refactoring: get rid of multiple versions of dns_request_createraw and dns_request_createvia 2018-04-06 08:04:41 +02:00
Witold Kręcicki
76e17b54ea libdns refactoring: get rid of two versions of dns_client_createx 2018-04-06 08:04:41 +02: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
c9f8165a06 [master] tag initializing keys
4798.	[func]		Keys specified in "managed-keys" statements
			are tagged as "initializing" until they have been
			updated by a key refresh query. If initialization
			fails it will be visible from "rndc secroots".
			[RT #46267]
2017-10-27 15:49:44 -07:00
Evan Hunt
3abcd7cd8a [master] Revert "[master] tag initializing keys so they can't be used for normal validation"
This reverts commit 560d8b833edceb4b715fe46b45f2009dc09fdb5d.

This change created a potential race between key refresh queries and
root zone priming queries which could leave the root name servers in
the bad-server cache.
2017-10-12 10:53:35 -07:00
Evan Hunt
560d8b833e [master] tag initializing keys so they can't be used for normal validation
4773.	[bug]		Keys specified in "managed-keys" statements
			can now only be used when validating key refresh
			queries during initialization of RFC 5011 key
			maintenance. If initialization fails, DNSSEC
			validation of normal queries will also fail.
			Previously, validation of normal queries could
			succeed using the initializing key, potentially
			masking problems with managed-keys. [RT #46077]
2017-10-11 21:01:13 -07:00
Mark Andrews
52fd57c989 4681. [bug] Log messages from the validator now include the
associated view unless the view is "_default/IN"
                        or "_dnsclient/IN". [RT #45770]
2017-08-16 09:29:20 +10:00
Mark Andrews
4bf32aa587 4654. [cleanup] Don't use C++ keywords delete, new and namespace.
[RT #45538]
2017-07-21 11:52:24 +10:00
Tinderbox User
bb01fced12 update copyright notice / whitespace 2017-05-30 23:45:32 +00:00
Mark Andrews
e51d62ecae 4629. [bug] dns_client_startupdate could not be called with a
running client. [RT #45277]
2017-05-30 09:47:41 +10:00
Mark Andrews
52e2aab392 4546. [func] Extend the use of const declarations. [RT #43379] 2016-12-30 15:45:08 +11:00
Mark Andrews
6f94747270 4543. [bug] dns_client_startupdate now delays sending the update
request until isc_app_ctxrun has been called.
                        [RT #43976]
2016-12-28 15:50:22 +11:00
Tinderbox User
c43f150d0a update copyright notice / whitespace 2016-12-26 23:46:20 +00:00
Mark Andrews
aceabacdb8 4538. [bug] Call dns_client_startresolve from client->task.
[RT #43896]
2016-12-27 07:02:33 +11:00
Mark Andrews
8ca45ba01a 4533. [bug] dns_client_update should terminate on prerequiste
failures (NXDOMAIN, YXDOMAIN, NXRRSET, YXRRSET)
                        and also on BADZONE.  [RT #43865]
2016-12-13 15:47:03 +11:00
Mark Andrews
ecfa005085 4403. [bug] Rename variables and arguments that shadow: basename,
clone and gai_error.
2016-06-28 21:25:30 -04:00
Mark Andrews
0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Mark Andrews
8a0b6b3901 4228. [bug] Address race condition in dns_client_destroyrestrans.
[RT #40605]
2015-09-30 14:58:31 +10:00
Evan Hunt
420a43c8d8 [master] timing safe memory comparisons
4183.	[cleanup]	Use timing-safe memory comparisons in cryptographic
			code. Also, the timing-safe comparison functions have
			been renamed to avoid possible confusion with
			memcmp(). [RT #40148]
2015-08-17 18:26:44 -07:00
Tinderbox User
431e5c81db update copyright notice / whitespace 2015-05-28 23:45:24 +00:00
Evan Hunt
a32b6291aa [master] address regression
4126.	[bug]		Addressed a regression introduced in change #4121.
			[RT #39611]
2015-05-26 19:11:08 -07:00
Evan Hunt
92384667ff [master] delv +tcp
4009.	[func]		delv: added a +tcp option. [RT #37855]
2014-11-21 09:42:04 -08:00
Evan Hunt
98922b2b2b [master] merge several interdependent fixes
3760.   [bug]           Improve SIT with native PKCS#11 and on Windows.
			[RT #35433]

3759.   [port]          Enable delve on Windows. [RT #35441]

3758.   [port]          Enable export library APIs on windows. [RT #35382]
2014-02-26 19:00:05 -08:00
Evan Hunt
6a3fa181d1 [master] add "--with-tuning=large" option
3745.	[func]		"configure --with-tuning=large" adjusts various
			compiled-in constants and default settings to
			values suited to large servers with abundant
			memory. [RT #29538]
2014-02-18 22:36:14 -08:00
Tinderbox User
72141595cf update copyright notice 2014-02-16 23:46:32 +00:00
Evan Hunt
1d761cb453 [master] delve
3741.	[func]		"delve" (domain entity lookup and validation engine):
			A new tool with dig-like semantics for performing DNS
			lookups, with internal DNSSEC validation, using the
			same resolver and validator logic as named. This
			allows easy validation of DNSSEC data in environments
			with untrustworthy resolvers, and assists with
			troubleshooting of DNSSEC problems. (Note: not yet
			available on win32.) [RT #32406]
2014-02-16 13:03:17 -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