Commit Graph
65 Commits
Author SHA1 Message Date
Michal Nowak afdb41a5aa Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
Tony Finch ec50c58f52 De-duplicate __FILE__, __LINE__
Mostly generated automatically with the following semantic patch,
except where coccinelle was confused by #ifdef in lib/isc/net.c

@@ expression list args; @@
- UNEXPECTED_ERROR(__FILE__, __LINE__, args)
+ UNEXPECTED_ERROR(args)
@@ expression list args; @@
- FATAL_ERROR(__FILE__, __LINE__, args)
+ FATAL_ERROR(args)
2022-10-17 11:58:26 +01:00
Aram Sargsyan c51b052827 dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset() can not fail
Clean up dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset()
functions by making them return void, because they cannot fail.

Clean up other functions that subsequently cannot fail.
2022-08-09 08:19:51 +00:00
Ondřej SurýandOndřej Surý 584f0d7a7e Simplify way we tag unreachable code with only ISC_UNREACHABLE()
Previously, the unreachable code paths would have to be tagged with:

    INSIST(0);
    ISC_UNREACHABLE();

There was also older parts of the code that used comment annotation:

    /* NOTREACHED */

Unify the handling of unreachable code paths to just use:

    UNREACHABLE();

The UNREACHABLE() macro now asserts when reached and also uses
__builtin_unreachable(); when such builtin is available in the compiler.
2022-03-25 08:33:43 +01:00
Ondřej Surý 58bd26b6cf Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.
2022-01-11 09:05:02 +01:00
Ondřej Surý 2e3a2eecfe Make isc_result a static enum
Remove the dynamic registration of result codes.  Convert isc_result_t
from unsigned + #defines into 32-bit enum type in grand unified
<isc/result.h> header.  Keep the existing values of the result codes
even at the expense of the description and identifier tables being
unnecessary large.

Additionally, add couple of:

    switch (result) {
    [...]
    default:
        break;
    }

statements where compiler now complains about missing enum values in the
switch statement.
2021-10-06 11:22:20 +02:00
Evan Hunt dcee985b7f update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Evan Hunt e851ed0bb5 apply the modified style 2020-02-13 15:05:06 -08:00
Ondřej Surý 056e133c4c Use clang-tidy to add curly braces around one-line statements
The command used to reformat the files in this commit was:

./util/run-clang-tidy \
	-clang-tidy-binary clang-tidy-11
	-clang-apply-replacements-binary clang-apply-replacements-11 \
	-checks=-*,readability-braces-around-statements \
	-j 9 \
	-fix \
	-format \
	-style=file \
	-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')
2020-02-13 22:07:21 +01:00
Ondřej Surý f50b1e0685 Use clang-format to reformat the source files 2020-02-12 15:04:17 +01:00
Ondřej Surý bc1d4c9cb4 Clear the pointer to destroyed object early using the semantic patch
Also disable the semantic patch as the code needs tweaks here and there because
some destroy functions might not destroy the object and return early if the
object is still in use.
2020-02-09 18:00:17 -08:00
Ondřej Surý 601cb4e4cc Use coccinelle to cleanup the failure handling blocks from isc_mem_allocate 2019-07-23 15:32:35 -04: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ý 78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01: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
Mark Andrews 0fc1b1bffa improve case presevation 2018-10-02 15:09:32 +10: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ý cb6a185c69 Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
Ondřej Surý 55a10b7acd Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
Michał Kępień 15afdf94ef Remove redundant assertions
The ENSURE assertion at the end of dns_diff_appendminimal() is not
needed because it is placed right after code which resets *tuplep to
NULL if it is not NULL already.

The INSIST assertion in move_matching_tuples() checks the same pointer
again.
2018-05-10 09:43:38 +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
Tinderbox User 38a9d9ba76 update copyright notice / whitespace 2018-01-21 23:45:57 +00:00
Mark Andrews fdd8838bf9 4869. [bug] Address some cases where NULL with zero length could
be passed to memmove which is undefined behaviour and
                        can lead to bad optimisation. [RT #46888]
2018-01-22 09:36:12 +11:00
Tinderbox User dc66c4a49c update copyright notice / whitespace 2017-11-29 23:45:31 +00:00
Mark Andrews 0579a11658 4831. [bug] Convert the RRSIG expirytime to 64 bits for
comparisions in diff.c:resign. [RT #46710]
2017-11-29 15:20:23 +11:00
Mark Andrews 52e2aab392 4546. [func] Extend the use of const declarations. [RT #43379] 2016-12-30 15:45:08 +11:00
Mark Andrews 0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Francis Dupont 3759f10fc5 added print.h includes, updated copyrights 2015-05-23 14:21:51 +02:00
Mark Andrews 29d52c001f 4081. [cleanup] Use dns_rdatalist_init consistently. [RT #38759] 2015-03-03 16:43:42 +11:00
Tinderbox User 34eab435ac update copyright notice / whitespace 2015-02-27 23:45:24 +00:00
Mark Andrews a8da00ef95 4079. [func] Preserve the case of the ownername of records to
the RRset level. [RT #37442]
2015-02-27 15:08:38 +11:00
Tinderbox User c110d61b17 update copyright notice / whitespace 2015-01-20 23:45:26 +00:00
Evan Hunt 11463c0ac2 [master] clean up gcc -Wshadow warnings
4039.	[cleanup]	Cleaned up warnings from gcc -Wshadow. [RT #37381]
2015-01-20 13:29:18 -08:00
Tinderbox User 431a83fb29 update copyright notice 2014-01-09 23:46:35 +00:00
Evan Hunt e851ea8260 [master] replace memcpy() with memmove().
3698.	[cleanup]	Replaced all uses of memcpy() with memmove().
			[RT #35120]
2014-01-08 16:39:05 -08:00
Evan Hunt 8e3b246dc8 [master] remove "resign" member from dns_diff struct
no longer needed since change #3641
2013-09-04 16:35:11 -07:00
Mark Andrews b5f4cc132e 3641. [bug] Handle changes to sig-validity-interval settings
better. [RT #34625]
2013-09-04 13:45:00 +10:00
Tinderbox User 573d78f3d5 update copyright notice 2013-02-21 23:45:56 +00:00
Evan Hunt df925e6c66 [master] add zone memory context pools
3492.	[bug]		Fixed a regression in zone loading performance
			due to lock contention. [RT #30399]
2013-02-20 21:39:05 -08:00
Evan Hunt 319b8a1488 3092. [bug] Signatures for records at the zone apex could go
stale due to an incorrect timer setting. [RT #23769]

3091.	[bug]		Fixed a bug in which zone keys that were published
			and then subsequently activated could fail to trigger
			automatic signing. [RT #22991]
2011-03-25 23:53:02 +00:00
Automatic Updater c1aef54e14 update copyright notice 2011-03-12 04:59:49 +00:00
Mark Andrews 0874abad14 3069. [cleanup] Silence warnings messages from clang static analysis.
[RT #20256]
2011-03-11 06:11:27 +00:00
Evan Hunt feeca57f18 2795. [cleanup] Add text to differentiate "update with no effect"
log messages. [RT #18889]
2009-12-01 00:47:09 +00:00
Evan Hunt fc1fb1a469 2786. [bug] Spurious log message when zone keys were
dynamically reconfigured. [RT #20659]
2009-11-25 02:30:54 +00:00
Mark Andrews d2c115f913 2590. [func] Report zone/class of "diff with no effect". [RT #19542] 2009-04-30 06:53:10 +00:00
Automatic Updater 5569e7de51 update copyright notice 2009-01-05 23:47:54 +00:00
Tatuya JINMEI 神明達哉 3fb1637c92 trivial comment cleanups (RT#19118) 2009-01-05 23:20:22 +00:00
Mark Andrews 6098d364b6 2448. [func] Add NSEC3 support. [RT #15452] 2008-09-24 02:46:23 +00:00
Mark Andrews 3f42cf2f3e 2349. [func] Provide incremental re-signing support for secure
dynamic zones. [RT #1091]

back out incorrect branch rt1091 and apply correct branch rt1091a.
2008-04-02 02:37:42 +00:00
Automatic Updater e672951ed2 update copyright notice 2008-04-01 23:47:10 +00:00