Compare commits

...
Author SHA1 Message Date
Mark Andrews 6c7e86aa51 suppress DOXYGEN 2020-02-03 17:44:15 +11:00
Mark Andrews 5c4917f66e remove unused label 2020-02-03 16:45:15 +11:00
Mark Andrews b7f9192ff1 add --library=std.cfg 2020-02-03 16:38:39 +11:00
Mark Andrews d9fa5d5a9a isc_mem_get cannot fail 2020-01-30 19:54:27 +11:00
Mark Andrews 6ab0b3d51a fixup! limit jobs when debugging cppcheck 2020-01-30 19:47:12 +11:00
Mark Andrews 8917d2f9b6 fixup! limit jobs when debugging cppcheck 2020-01-30 19:45:36 +11:00
Mark Andrews 1a8b581510 isc_mem_get cannot fail 2020-01-30 19:41:32 +11:00
Mark Andrews 2c823cc84f delay assignment until after REQUIRE 2020-01-30 19:38:47 +11:00
Mark Andrews e4e753f46a fixup! limit jobs when debugging cppcheck 2020-01-30 19:14:27 +11:00
Mark Andrews 228e769d75 fixup! limit jobs when debugging cppcheck 2020-01-30 19:11:14 +11:00
Mark Andrews 3590a811a2 fixup! limit jobs when debugging cppcheck 2020-01-30 19:07:04 +11:00
Mark Andrews 4de0a36a42 fixup! limit jobs when debugging cppcheck 2020-01-30 19:00:24 +11:00
Mark Andrews bbe83c3b2a delay assignment until after REQUIRE 2020-01-30 18:56:03 +11:00
Mark Andrews fe745d238d skip if first is NULL 2020-01-30 18:55:36 +11:00
Mark Andrews f1326c124a limit jobs when debugging cppcheck 2020-01-30 18:41:50 +11:00
Mark Andrews 05cb183b91 fixup! delay assignment until after REQUIRE 2020-01-30 18:24:22 +11:00
Mark Andrews b7b62bf0b2 delay assignment until after REQUIRE 2020-01-30 18:19:11 +11:00
Mark Andrews 2c17edf417 make expression logical for cppcheck 2020-01-30 17:57:25 +11:00
Mark Andrews feba3113c4 remove brackets 2020-01-30 17:49:15 +11:00
Mark Andrews 18194962f2 simplify ISC_LIKELY/ISC_UNLIKELY for CPPCHECK 2020-01-30 17:27:08 +11:00
Mark Andrews d3786c0cf1 simplify RUNTIME_CHECK for cppcheck 2020-01-30 17:14:42 +11:00
Mark Andrews 1c2f8ab09f add untracked 2020-01-30 16:42:27 +11:00
Mark Andrews 2f7613333f fixup! add --dump 2020-01-30 16:15:47 +11:00
Mark Andrews 0ff879f145 add --dump 2020-01-30 16:13:21 +11:00
Michał Kępień 77332eb2c8 Merge branch 'michal/list-atypical-failures-in-system-test-summary' into 'master'
List atypical failures in system test summary

See merge request isc-projects/bind9!2964
2020-01-29 14:42:19 +00:00
Michał Kępień a8836b381f List atypical failures in system test summary
Each system test can be marked as failed not only due to some tested
component(s) not behaving as expected, but also because of core dumps,
assertion failures, and/or ThreadSanitizer reports being found among its
artifacts.  Make the system test summary list the tests which exhibit
such atypical symptoms to more clearly present the nature of problems
found.
2020-01-29 14:50:26 +01:00
Mark Andrews 4f9bfe1460 Merge branch '1508-case-system-test-failed' into 'master'
Resolve "case system test failed."

Closes #1508

See merge request isc-projects/bind9!2774
2020-01-28 21:21:45 +00:00
Mark Andrews 7b0ba6eb10 wait longer for dynamic zone to be transfered 2020-01-28 04:38:38 +00:00
Evan Hunt 6adcd739ca Merge branch 'each-history-typo' into 'master'
fixed a typo

See merge request isc-projects/bind9!2960
2020-01-24 17:55:29 +00:00
Evan Hunt 0147acd7b6 fixed a typo 2020-01-24 09:54:22 -08:00
Mark Andrews e48b2424aa Merge branch '1559-dnssec-system-test-failed-reload-of-root-server-not-completed-in-time' into 'master'
Resolve "dnssec system test failed: reload of root server not completed in time."

Closes #1559

See merge request isc-projects/bind9!2877
2020-01-23 22:01:11 +00:00
Mark Andrews 784e64f238 wait for root server to complete reloading 2020-01-23 21:39:18 +00:00
Mark Andrews ed52ffba38 Merge branch '1579-dnstap-system-test-appears-to-be-timing-sensitive' into 'master'
Resolve "dnstap system test appears to be timing sensitive"

Closes #1579

See merge request isc-projects/bind9!2950
2020-01-23 21:13:18 +00:00
Mark Andrews 9b6df37303 wait for the ./NS lookup to complete 2020-01-23 19:16:05 +00:00
Mark Andrews 4a992c7a18 check that all servers have finished loading before beginging tests 2020-01-23 19:16:05 +00:00
Mark Andrews a1a5559a8a Merge branch 'marka-signing-clear-notify' into 'master'
Send NOTIFY messages after deleting private-type records.

See merge request isc-projects/bind9!2942
2020-01-23 09:46:31 +00:00
Tony FinchandMark Andrews f3f7b7df5d Send NOFITY messages after deleting private-type records.
The `rndc signing -clear` command cleans up the private-type records
that keep track of zone signing activity, but before this change it
did not tell the secondary servers that the zone has changed.
2020-01-23 07:36:03 +00:00
Mark Andrews 7443bd5cc7 Merge branch '1572-wait-for-mirror-zone-to-be-deleted' into 'master'
Resolve "Wait for mirror zone to be deleted"

Closes #1572

See merge request isc-projects/bind9!2941
2020-01-23 05:09:19 +00:00
Mark Andrews c6ba51cfc4 wait for log message before testing that mirror zone is correctly removed 2020-01-23 04:00:53 +00:00
Mark Andrews 82c418abfa Merge branch '1522-pad-system-test-is-timing-sensitive' into 'master'
Resolve "padding system test is timing sensitive"

Closes #907 and #1522

See merge request isc-projects/bind9!2782
2020-01-23 03:15:07 +00:00
Mark Andrews b3f06729e5 address timing issues in padding system test
'rndc stats' is not instantaneous. Wait for the dump to complete
before looking at the content.
2020-01-23 12:43:03 +11:00
21 changed files with 173 additions and 74 deletions
+32
View File
@@ -29,6 +29,9 @@ variables:
TARBALL_COMPRESSOR: xz
TARBALL_EXTENSION: xz
# limit jobs when debugging cppcheck
DEBUG_CPPCHECK: 1
stages:
- precheck
- build
@@ -209,6 +212,9 @@ stages:
artifacts:
untracked: true
expire_in: "1 day"
except:
variables:
- $DEBUG_CPPCHECK == "1"
.windows_build: &windows_build_job
stage: build
@@ -239,6 +245,9 @@ stages:
artifacts:
untracked: true
expire_in: "1 day"
except:
variables:
- $DEBUG_CPPCHECK == "1"
.setup_interfaces: &setup_interfaces |
if [ "$(id -u)" -eq "0" ]; then
@@ -263,6 +272,9 @@ stages:
untracked: true
expire_in: "1 day"
when: on_failure
except:
variables:
- $DEBUG_CPPCHECK == "1"
.kyua_report: &kyua_report_html |
kyua --logfile /dev/null report-html \
@@ -311,12 +323,17 @@ stages:
- kyua_html/
expire_in: "1 day"
when: on_failure
except:
variables:
- $DEBUG_CPPCHECK == "1"
.cppcheck_args: &run_cppcheck |
cppcheck --enable=warning,performance,portability,information,missingInclude \
--dump \
--include=config.h \
--quiet \
--std=c11 \
--library=std.cfg \
--language=c \
--project=compile_commands.json \
--error-exitcode=2 \
@@ -325,6 +342,7 @@ stages:
--output-file=cppcheck.results \
--relative-paths="$CI_PROJECT_DIR" \
--inline-suppr \
-U DOXYGEN \
--suppressions-list=util/suppressions.txt
.cppcheck_report: &cppcheck_report_html |
@@ -343,6 +361,7 @@ stages:
after_script:
- *cppcheck_report_html
artifacts:
untracked: true
paths:
- compile_commands.json
- cppcheck.results
@@ -426,6 +445,9 @@ docs:sid:amd64:
paths:
- doc/arm/
expire_in: "1 day"
except:
variables:
- $DEBUG_CPPCHECK == "1"
push:docs:sid:amd64:
<<: *debian_sid_amd64_image
@@ -634,6 +656,9 @@ scan-build:buster:amd64:
- scan-build.reports/
expire_in: "1 day"
when: on_failure
except:
variables:
- $DEBUG_CPPCHECK == "1"
# Jobs for regular GCC builds on Debian Sid (amd64)
@@ -644,6 +669,7 @@ gcc:sid:amd64:
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
RUN_MAKE_INSTALL: 1
MAKE: bear make
DEBUG_CPPCHECK: 0
<<: *debian_sid_amd64_image
<<: *build_job
@@ -1129,6 +1155,9 @@ system:msvc:windows:amd64:
dependencies:
- msvc:windows:amd64
needs: ["msvc:windows:amd64"]
except:
variables:
- $DEBUG_CPPCHECK == "1"
msvc-debug:windows:amd64:
<<: *windows_build_job
@@ -1146,6 +1175,9 @@ system:msvc-debug:windows:amd64:
dependencies:
- msvc-debug:windows:amd64
needs: ["msvc-debug:windows:amd64"]
except:
variables:
- $DEBUG_CPPCHECK == "1"
# Job producing a release tarball
+1 -1
View File
@@ -150,7 +150,7 @@ releases. New features include:
- "rndc modzone" reconfigures a single zone, without requiring the entire
server to be reconfigured.
- "rndc showzone" displays the current configuration of a zone.
- "rndc managed-keys" can be used to check the status of RFC 5001 managed
- "rndc managed-keys" can be used to check the status of RFC 5011 managed
trust anchors, or to force trust anchors to be refreshed.
- "max-cache-size" can now be set to a percentage of available memory. The
default is 90%.
+20 -10
View File
@@ -14,6 +14,12 @@ SYSTEMTESTTOP=..
DIGOPTS="+tcp +nosea +nostat +noquest +nocomm +nocmd -p ${PORT}"
wait_for_serial() (
$DIG $DIGOPTS "@$1" "$2" SOA > "$4"
serial=$(awk '$4 == "SOA" { print $7 }' "$4")
[ "$3" -eq "${serial:--1}" ]
)
status=0
n=0
@@ -91,11 +97,13 @@ digcomp dig.ns1.test$n postupdate.good || ret=1
test $ret -eq 0 || echo_i "failed"
status=`expr $status + $ret`
for i in 1 2 3 4 5 6 7 8 9
do
$DIG $DIGOPTS soa dynamic @10.53.0.2 | grep 2000042408 > /dev/null && break
sleep 1
done
n=`expr $n + 1`
ret=0
echo_i "wait for zone to transfer ($n)"
retry_quiet 20 wait_for_serial 10.53.0.2 dynamic 2000042408 dig.ns2.test$n || ret=1
test $ret -eq 0 || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check SOA owner case is transfered to slave ($n)"
@@ -121,11 +129,13 @@ digcomp dig.ns1.test$n postns1.good || ret=1
test $ret -eq 0 || echo_i "failed"
status=`expr $status + $ret`
for i in 1 2 3 4 5 6 7 8 9
do
$DIG $DIGOPTS soa dynamic @10.53.0.2 | grep 2000042409 > /dev/null && break
sleep 1
done
n=`expr $n + 1`
ret=0
echo_i "wait for zone to transfer ($n)"
retry_quiet 20 wait_for_serial 10.53.0.2 dynamic 2000042409 dig.ns2.test$n || ret=1
test $ret -eq 0 || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check A owner case is transfered to slave ($n)"
+2 -2
View File
@@ -378,14 +378,14 @@ nextpartpeek() {
_search_log() (
msg="$1"
file="$2"
nextpart "$file" | grep -F "$msg" > /dev/null
nextpart "$file" | grep -F -e "$msg" > /dev/null
)
# _search_log_peek: look for message $1 in file $2 with nextpartpeek().
_search_log_peek() (
msg="$1"
file="$2"
nextpartpeek "$file" | grep -F "$msg" > /dev/null
nextpartpeek "$file" | grep -F -e "$msg" > /dev/null
)
# wait_for_log: wait until message $2 in file $3 appears. Bail out after
+8
View File
@@ -3671,11 +3671,19 @@ dig_with_opts . dnskey +ednsopt=KEY-TAG:fffe +ednsopt=KEY-TAG:fffd @10.53.0.1 >
grep "trust-anchor-telemetry './IN' from .* 65534" ns1/named.run > /dev/null || ret=1
grep "trust-anchor-telemetry './IN' from .* 65533" ns1/named.run > /dev/null && ret=1
$PERL $SYSTEMTESTTOP/stop.pl dnssec ns1 || ret=1
nextpart ns1/named.run > /dev/null
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} dnssec ns1 || ret=1
n=$(($n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "waiting for root server to finish reloading ($n)"
ret=0
wait_for_log 20 "all zones loaded" ns1/named.run || ret=1
n=$(($n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "check that the view is logged in messages from the validator when using views ($n)"
ret=0
grep "view rec: *validat" ns4/named.run > /dev/null || ret=1
+1
View File
@@ -12,6 +12,7 @@
rm -f */named.conf
rm -f */named.memstats
rm -f */named.run
rm -f */named.run.prev
rm -f */named.stats
rm -f dig.out*
rm -f dnstap.out dnstap.hex
+15
View File
@@ -35,7 +35,21 @@ do
status=`expr $status + $ret`
done
echo_i "wait for servers to finish loading"
ret=0
wait_for_log 20 "all zones loaded" ns1/named.run || ret=1
wait_for_log 20 "all zones loaded" ns2/named.run || ret=1
wait_for_log 20 "all zones loaded" ns3/named.run || ret=1
wait_for_log 20 "all zones loaded" ns4/named.run || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# both the 'a.example/A' lookup and the './NS' lookup to ns1
# need tocomplete before reopening/rolling for the counts to
# be correct.
$DIG $DIGOPTS @10.53.0.3 a.example > dig.out
wait_for_log 20 "(./NS): query_reset" ns1/named.run || true
# check three different dnstap reopen/roll methods:
# ns1: dnstap-reopen; ns2: dnstap -reopen; ns3: dnstap -roll
@@ -71,6 +85,7 @@ EOF
$RNDCCMD -s 10.53.0.1 stop | sed 's/^/ns1 /' | cat_i
$RNDCCMD -s 10.53.0.2 stop | sed 's/^/ns2 /' | cat_i
$RNDCCMD -s 10.53.0.3 stop | sed 's/^/ns3 /' | cat_i
sleep 1
echo_i "checking initial message counts"
+2
View File
@@ -540,7 +540,9 @@ n=`expr $n + 1`
echo_i "checking that a mirror zone can be deleted using rndc ($n)"
ret=0
# Remove the mirror zone added in the previous test.
nextpart ns3/named.run > /dev/null
$RNDCCMD 10.53.0.3 delzone verify-addzone > rndc.out.ns3.test$n 2>&1 || ret=1
wait_for_log 20 "zone verify-addzone/IN: mirror zone is no longer in use; reverting to normal recursion" ns3/named.run || ret=1
# Check whether the mirror zone was removed.
$DIG $DIGOPTS @10.53.0.3 +norec verify-addzone SOA > dig.out.ns3.test$n 2>&1 || ret=1
grep "NXDOMAIN" dig.out.ns3.test$n > /dev/null || ret=1
+1
View File
@@ -11,6 +11,7 @@ rm -f dig.out.*
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/named.stats
rm -f ns*/named.stats.prev
rm -f ns*/named.lock
rm -f ns*/named.conf
rm -f ns*/managed-keys.bind*
+4
View File
@@ -12,7 +12,11 @@
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
$SHELL ./clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
touch ns2/named.stats
+16 -11
View File
@@ -36,8 +36,11 @@ status=`expr $status + $ret`
echo_i "checking that dig added padding ($n)"
ret=0
n=`expr $n + 1`
nextpart ns2/named.stats > /dev/null
$RNDCCMD 10.53.0.2 stats
grep "EDNS padding option received" ns2/named.stats > /dev/null || ret=1
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
nextpart ns2/named.stats | grep "EDNS padding option received" > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -88,28 +91,30 @@ status=`expr $status + $ret`
echo_i "checking that a TCP and padding server config enables padding ($n)"
ret=0
n=`expr $n + 1`
nextpart ns2/named.stats > /dev/null
$RNDCCMD 10.53.0.2 stats
opad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
opad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
$DIG $DIGOPTS foo.example @10.53.0.3 > dig.out.test$n
$RNDCCMD 10.53.0.2 stats
npad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
if [ "$opad" -eq "$npad" ]; then ret=1; fi
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
npad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
if [ "$opad" -eq "$npad" ]; then echo_i "error: opad ($opad) == npad ($npad)"; ret=1; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking that a padding server config should enforce TCP ($n)"
ret=0
n=`expr $n + 1`
nextpart ns2/named.stats > /dev/null
$RNDCCMD 10.53.0.2 stats
opad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
opad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
$DIG $DIGOPTS foo.example @10.53.0.4 > dig.out.test$n
$RNDCCMD 10.53.0.2 stats
npad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
if [ "$opad" -ne "$npad" ]; then ret=1; fi
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
npad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
if [ "$opad" -ne "$npad" ]; then echo_i "error: opad ($opad) != npad ($npad)"; ret=1; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+18
View File
@@ -56,6 +56,24 @@ if [ -n "${FAILED_TESTS}" ]; then
status=1
fi
CRASHED_TESTS=`find . -name 'core*' -or -name '*.core' | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /'`
if [ -n "${CRASHED_TESTS}" ]; then
echoinfo "I:Core dumps were found for the following system tests:"
echoinfo "${CRASHED_TESTS}"
fi
ASSERTION_FAILED_TESTS=`find . -name named.run | xargs grep "assertion failure" | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /'`
if [ -n "${ASSERTION_FAILED_TESTS}" ]; then
echoinfo "I:Assertion failures were detected for the following system tests:"
echoinfo "${ASSERTION_FAILED_TESTS}"
fi
TSAN_REPORT_TESTS=`find . -name 'tsan.*' | cut -d'/' -f2 | sort -u | sed -e 's/^/I: /'`
if [ -n "${TSAN_REPORT_TESTS}" ]; then
echoinfo "I:ThreadSanitizer reported issues for the following system tests:"
echoinfo "${TSAN_REPORT_TESTS}"
fi
RESULTS_FOUND=`grep -c 'R:[a-z0-9_-][a-z0-9_-]*:[A-Z][A-Z]*' systests.output`
TESTS_RUN=`echo "${SUBDIRS}" | wc -w`
if [ "${RESULTS_FOUND}" -ne "${TESTS_RUN}" ]; then
+1 -1
View File
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
UNUSED(argc);
UNUSED(argv);
target = target ? target + 1 : argv[0];
target = (target != NULL) ? target + 1 : argv[0];
if (strncmp(target, "lt-", 3) == 0) {
target += 3;
}
+7 -22
View File
@@ -1340,13 +1340,7 @@ dns_client_startresolve(dns_client_t *client, const dns_name_t *name,
ISC_LIST_INIT(event->answerlist);
rctx = isc_mem_get(mctx, sizeof(*rctx));
if (rctx == NULL)
result = ISC_R_NOMEMORY;
else {
isc_mutex_init(&rctx->lock);
}
if (result != ISC_R_SUCCESS)
goto cleanup;
isc_mutex_init(&rctx->lock);
result = getrdataset(mctx, &rdataset);
if (result != ISC_R_SUCCESS)
@@ -1748,13 +1742,7 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage,
action, arg, sizeof(*event));
ctx = isc_mem_get(client->mctx, sizeof(*ctx));
if (ctx == NULL)
result = ISC_R_NOMEMORY;
else {
isc_mutex_init(&ctx->lock);
}
if (result != ISC_R_SUCCESS)
goto cleanup;
isc_mutex_init(&ctx->lock);
ctx->client = client;
ISC_LINK_INIT(ctx, link);
@@ -1787,14 +1775,11 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage,
isc_refcount_decrement(&client->references);
cleanup:
if (ctx != NULL) {
LOCK(&client->lock);
ISC_LIST_UNLINK(client->reqctxs, ctx, link);
UNLOCK(&client->lock);
isc_mutex_destroy(&ctx->lock);
isc_mem_put(client->mctx, ctx, sizeof(*ctx));
}
LOCK(&client->lock);
ISC_LIST_UNLINK(client->reqctxs, ctx, link);
UNLOCK(&client->lock);
isc_mutex_destroy(&ctx->lock);
isc_mem_put(client->mctx, ctx, sizeof(*ctx));
if (event != NULL)
isc_event_free(ISC_EVENT_PTR(&event));
isc_task_detach(&tclone);
+3 -2
View File
@@ -130,7 +130,7 @@ static isc_result_t
write_data(FILE *file, unsigned char *datap, void *arg, uint64_t *crc) {
isc_result_t result;
size_t ret = 0;
data_holder_t *data = (data_holder_t *)datap;
data_holder_t *data;
data_holder_t temp;
off_t where;
@@ -138,7 +138,8 @@ write_data(FILE *file, unsigned char *datap, void *arg, uint64_t *crc) {
REQUIRE(file != NULL);
REQUIRE(crc != NULL);
REQUIRE(data != NULL);
REQUIRE(datap != NULL);
data = (data_holder_t *)datap;
REQUIRE((data->len == 0 && data->data == NULL) ||
(data->len != 0 && data->data != NULL));
+2 -1
View File
@@ -19576,7 +19576,8 @@ keydone(isc_task_t *task, isc_event_t *event) {
commit = true;
LOCK_ZONE(zone);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED);
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED|
DNS_ZONEFLG_NEEDNOTIFY);
zone_needdump(zone, 30);
UNLOCK_ZONE(zone);
}
+8 -8
View File
@@ -1215,15 +1215,15 @@ verify_nsec3_chains(const vctx_t *vctx, isc_mem_t *mctx) {
result = ISC_R_FAILURE;
}
if (first == NULL || newchain(first, e)) {
if (prev != NULL) {
if (!checknext(vctx, prev, first)) {
result = ISC_R_FAILURE;
}
if (prev != first) {
free_element(mctx, prev);
}
}
if (first != NULL) {
if (prev != NULL) {
if (!checknext(vctx, prev, first)) {
result = ISC_R_FAILURE;
}
if (prev != first) {
free_element(mctx, prev);
}
}
free_element(mctx, first);
}
prev = first = e;
+5
View File
@@ -15,6 +15,10 @@
/*%
* Performance
*/
#ifdef CPPCHECK
#define ISC_LIKELY(x) (x)
#define ISC_UNLIKELY(x) (x)
#else
#ifdef HAVE_BUILTIN_EXPECT
#define ISC_LIKELY(x) __builtin_expect(!!(x), 1)
#define ISC_UNLIKELY(x) __builtin_expect(!!(x), 0)
@@ -22,5 +26,6 @@
#define ISC_LIKELY(x) (x)
#define ISC_UNLIKELY(x) (x)
#endif
#endif
#endif /* ISC_LIKELY_H */
+6 -1
View File
@@ -285,12 +285,17 @@ extern void mock_assert(const int result, const char* const expression,
#ifdef UNIT_TESTING
#define RUNTIME_CHECK(expression) \
mock_assert((int)(expression), #expression, __FILE__, __LINE__)
((!(expression)) ? \
(mock_assert(0, #expression, __FILE__, __LINE__), abort()) : (void)0)
#else /* UNIT_TESTING */
#ifndef CPPCHECK
/*% Runtime Check */
#define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond)
#else
#define RUNTIME_CHECK(e) if (!(e)) abort()
#endif
#endif /* UNIT_TESTING */
+2 -2
View File
@@ -103,10 +103,10 @@ void isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line);
#if ISC_MUTEX_PROFILE
#define isc_mutex_destroy(mp) \
(RUNTIME_CHECK(pthread_mutex_destroy((&(mp)->mutex)) == 0))
RUNTIME_CHECK(pthread_mutex_destroy((&(mp)->mutex)) == 0)
#else
#define isc_mutex_destroy(mp) \
(RUNTIME_CHECK(pthread_mutex_destroy((mp)) == 0))
RUNTIME_CHECK(pthread_mutex_destroy((mp)) == 0)
#endif
#if ISC_MUTEX_PROFILE
+19 -13
View File
@@ -239,7 +239,7 @@ isc_timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
isc_task_t *task, isc_taskaction_t action, void *arg,
isc_timer_t **timerp)
{
isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
isc__timermgr_t *manager;
isc__timer_t *timer;
isc_result_t result;
isc_time_t now;
@@ -252,7 +252,8 @@ isc_timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
* in 'timerp'.
*/
REQUIRE(VALID_MANAGER(manager));
REQUIRE(VALID_MANAGER(manager0));
manager = (isc__timermgr_t *)manager0;
REQUIRE(task != NULL);
REQUIRE(action != NULL);
if (expires == NULL)
@@ -352,7 +353,7 @@ isc_timer_reset(isc_timer_t *timer0, isc_timertype_t type,
const isc_time_t *expires, const isc_interval_t *interval,
bool purge)
{
isc__timer_t *timer = (isc__timer_t *)timer0;
isc__timer_t *timer;
isc_time_t now;
isc__timermgr_t *manager;
isc_result_t result;
@@ -363,7 +364,8 @@ isc_timer_reset(isc_timer_t *timer0, isc_timertype_t type,
* are purged from its task's event queue.
*/
REQUIRE(VALID_TIMER(timer));
REQUIRE(VALID_TIMER(timer0));
timer = (isc__timer_t *)timer0;
manager = timer->manager;
REQUIRE(VALID_MANAGER(manager));
@@ -425,10 +427,11 @@ isc_timer_reset(isc_timer_t *timer0, isc_timertype_t type,
isc_timertype_t
isc_timer_gettype(isc_timer_t *timer0) {
isc__timer_t *timer = (isc__timer_t *)timer0;
isc__timer_t *timer;
isc_timertype_t t;
REQUIRE(VALID_TIMER(timer));
REQUIRE(VALID_TIMER(timer0));
timer = (isc__timer_t *)timer0;
LOCK(&timer->lock);
t = timer->type;
@@ -439,7 +442,7 @@ isc_timer_gettype(isc_timer_t *timer0) {
isc_result_t
isc_timer_touch(isc_timer_t *timer0) {
isc__timer_t *timer = (isc__timer_t *)timer0;
isc__timer_t *timer;
isc_result_t result;
isc_time_t now;
@@ -447,7 +450,8 @@ isc_timer_touch(isc_timer_t *timer0) {
* Set the last-touched time of 'timer' to the current time.
*/
REQUIRE(VALID_TIMER(timer));
REQUIRE(VALID_TIMER(timer0));
timer = (isc__timer_t *)timer0;
LOCK(&timer->lock);
@@ -470,13 +474,14 @@ isc_timer_touch(isc_timer_t *timer0) {
void
isc_timer_attach(isc_timer_t *timer0, isc_timer_t **timerp) {
isc__timer_t *timer = (isc__timer_t *)timer0;
isc__timer_t *timer;
/*
* Attach *timerp to timer.
*/
REQUIRE(VALID_TIMER(timer));
REQUIRE(VALID_TIMER(timer0));
timer = (isc__timer_t *)timer0;
REQUIRE(timerp != NULL && *timerp == NULL);
isc_refcount_increment(&timer->references);
@@ -661,8 +666,8 @@ static void
set_index(void *what, unsigned int index) {
isc__timer_t *timer;
REQUIRE(VALID_TIMER(what));
timer = what;
REQUIRE(VALID_TIMER(timer));
timer->index = index;
}
@@ -707,9 +712,10 @@ isc_timermgr_create(isc_mem_t *mctx, isc_timermgr_t **managerp) {
void
isc_timermgr_poke(isc_timermgr_t *manager0) {
isc__timermgr_t *manager = (isc__timermgr_t *)manager0;
isc__timermgr_t *manager;
REQUIRE(VALID_MANAGER(manager));
REQUIRE(VALID_MANAGER(manager0));
manager = (isc__timermgr_t *)manager0;
SIGNAL(&manager->wakeup);
}