Compare commits

...
Author SHA1 Message Date
Suzanne Goldlust 4d9a557190 Remove reference to ISC donation 2019-11-26 17:09:20 +00:00
Suzanne Goldlust 4cc36f925c Remove reference to ISC donation 2019-11-26 17:08:18 +00:00
Suzanne Goldlust 65ad25bb86 Remove reference to ISC donation 2019-11-26 17:07:25 +00:00
Ondřej Surý d0bc45be17 Merge branch '1354-threadsanitizer-data-race-message-c-3283-in-dns_message_sectiontotext' into 'master'
Resolve "ThreadSanitizer: data race message.c:3283 in dns_message_sectiontotext"

Closes #1354

See merge request isc-projects/bind9!2578
2019-11-26 13:00:01 +00:00
Mark AndrewsandOndřej Surý f269585de3 provide default yaml indent 2019-11-26 13:52:30 +01:00
Mark AndrewsandOndřej Surý 9936462f31 dns_master_indent and dns_master_indentstr must not be global
The indentation for dumping the master zone was driven by two
global variables dns_master_indent and dns_master_indentstr.  In
threaded mode, this becomes prone to data access races, so this commit
converts the global variables into a local per-context tuple that
consist of count and string.
2019-11-26 13:52:18 +01:00
Ondřej Surý caf18da7f6 Merge branch '1360-threadsanitizer-data-race-adb-c-2790-in-dns_adb_detach' into 'master'
Resolve "ThreadSanitizer: data race adb.c:2790 in dns_adb_detach"

Closes #1360

See merge request isc-projects/bind9!2595
2019-11-26 12:16:59 +00:00
Ondřej Surý 21eab267df Fix missing adb->{e,i}refcnt locking 2019-11-26 13:07:12 +01:00
Witold KręcickiandOndřej Surý bad5a523c2 lib/dns/adb.c: Use atomics for adb quota values and reference counting 2019-11-26 13:07:12 +01:00
Ondřej SurýandOndřej Surý b9f4ba19a6 Use integer fast type for mutexatomic shim type 2019-11-26 13:07:12 +01:00
Ondřej Surý 70e9068432 Merge branch '1383-kasp-test-fails-with-unexpected-cds-record' into 'master'
kasp: Fix the reading of CDS keys to use stricter awk

Closes #1383

See merge request isc-projects/bind9!2608
2019-11-26 11:59:32 +00:00
Ondřej Surý d4163e2e97 kasp: Employ awk to make CDS checks stricter 2019-11-26 12:54:27 +01:00
Ondřej Surý ac1f0d9d61 Merge branch '1403-when-configuration-loading-fails-named-could-assert' into 'master'
Request exclusive access when crashing via fatal()

Closes #1403

See merge request isc-projects/bind9!2635
2019-11-26 11:51:02 +00:00
Ondřej Surý 952d7fde63 Request exclusive access when crashing via fatal()
When loading the configuration fails, there might be already other tasks
running and calling OpenSSL library functions.  The OpenSSL on_exit
handler is called when exiting the main process and there's a timing
race between the on_exit function that destroys OpenSSL allocated
resources (threads, locks, ...) and other tasks accessing the very same
resources leading to a crash in the system threading library. Therefore,
the fatal() function needs to request exlusive access to the task
manager to finish the already running tasks and exit only when no other
tasks are running.
2019-11-26 12:47:01 +01:00
Ondřej Surý bfc041def1 Merge branch 'ondrej/detect-cores-in-system-tests-on-FreeBSD' into 'master'
Detect cores on FreeBSD

See merge request isc-projects/bind9!2634
2019-11-26 11:44:22 +00:00
Ondřej Surý 38277ddb0b Detect cores on FreeBSD 2019-11-26 12:42:16 +01:00
Ondřej Surý eb524d27d9 Merge branch '1380-autosign-jitter-test-fails-with-no-nsec3param-found-in-axfr' into 'master'
Tune the performance of the autosign test

Closes #1385, #1384, and #1380

See merge request isc-projects/bind9!2601
2019-11-26 11:41:48 +00:00
Ondřej Surý 4b2911a45a Reduce the minimal numbers of days in jitter test to 5 2019-11-26 12:07:01 +01:00
Ondřej Surý 76eac9a691 Tune the performance of CDS/CDNSKEY deletion test 2019-11-26 12:07:01 +01:00
Ondřej Surý 519b047362 Tune the performance of oldsigs test
The oldsigs test was checking only for the validity of the A
a.oldsigs.example. resource record and associated DNSSEC signature while
the zone might not have been fully signed yet leading to validation
failures because of bogus signatures on the validation path.

This commit changes the test to test that all old signatures in the
oldsigs.example. zone were replaced and the zone is fully resigned
before running the main check.
2019-11-26 12:07:01 +01:00
Ondřej Surý ffb7ae8beb Tune the performance of the jitter test 2019-11-26 12:07:01 +01:00
24 changed files with 229 additions and 204 deletions
+5 -4
View File
@@ -498,14 +498,17 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
dns_rdata_reset(&rdata);
}
} else {
dns_indent_t indent = { " ", 2 };
if (!yaml && (rdataset->attributes &
DNS_RDATASETATTR_NEGATIVE) != 0)
{
isc_buffer_putstr(&target, "; ");
}
result = dns_master_rdatasettotext(owner, rdataset,
style, &target);
style,
yaml ? &indent :
NULL,
&target);
}
if (result == ISC_R_NOSPACE) {
@@ -537,8 +540,6 @@ setup_style(dns_master_style_t **stylep) {
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (yaml) {
styleflags |= DNS_STYLEFLAG_YAML;
dns_master_indentstr = " ";
dns_master_indent = 2;
} else {
if (showcomments) {
styleflags |= DNS_STYLEFLAG_COMMENT;
+2 -2
View File
@@ -487,8 +487,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (yaml) {
dns_master_indentstr = " ";
dns_master_indent = 3;
msg->indent.string = " ";
msg->indent.count = 3;
styleflags |= DNS_STYLEFLAG_YAML;
} else {
if (query->lookup->comments) {
+1 -1
View File
@@ -372,7 +372,7 @@ formatset(dns_rdataset_t *rdataset) {
result = isc_buffer_allocate(mctx, &buf, MAX_CDS_RDATA_TEXT_SIZE);
check_result(result, "printing DS records");
result = dns_master_rdatasettotext(name, rdataset, style, buf);
result = dns_master_rdatasettotext(name, rdataset, style, NULL, buf);
if ((result == ISC_R_SUCCESS) && isc_buffer_availablelength(buf) < 1) {
result = ISC_R_NOSPACE;
+2 -1
View File
@@ -246,7 +246,8 @@ dumpnode(dns_name_t *name, dns_dbnode_t *node) {
for (;;) {
result = dns_master_rdatasettotext(name, &rds,
masterstyle, buffer);
masterstyle, NULL,
buffer);
if (result != ISC_R_NOSPACE)
break;
+14 -5
View File
@@ -201,8 +201,8 @@
#define CHECKFATAL(op, msg) \
do { result = (op); \
if (result != ISC_R_SUCCESS) \
fatal(msg, result); \
if (result != ISC_R_SUCCESS) \
fatal(server, msg, result); \
} while (0) \
/*%
@@ -431,7 +431,8 @@ const char *empty_zones[] = {
};
ISC_PLATFORM_NORETURN_PRE static void
fatal(const char *msg, isc_result_t result) ISC_PLATFORM_NORETURN_POST;
fatal(named_server_t *server,const char *msg, isc_result_t result)
ISC_PLATFORM_NORETURN_POST;
static void
named_server_reload(isc_task_t *task, isc_event_t *event);
@@ -9805,7 +9806,7 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
named_server_t *server = isc_mem_get(mctx, sizeof(*server));
if (server == NULL)
fatal("allocating server object", ISC_R_NOMEMORY);
fatal(server, "allocating server object", ISC_R_NOMEMORY);
server->mctx = mctx;
server->task = NULL;
@@ -10016,7 +10017,15 @@ named_server_destroy(named_server_t **serverp) {
}
static void
fatal(const char *msg, isc_result_t result) {
fatal(named_server_t *server, const char *msg, isc_result_t result) {
if (server != NULL) {
/*
* Prevent races between the OpenSSL on_exit registered
* function and any other OpenSSL calls from other tasks
* by requesting exclusive access to the task manager.
*/
(void)isc_task_beginexclusive(server->task);
}
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_CRITICAL,
"%s: %s", msg, isc_result_totext(result));
@@ -101,6 +101,8 @@ zone "jitter.nsec3.example" {
allow-update { any; };
auto-dnssec maintain;
sig-validity-interval 10 2;
sig-signing-nodes 1000;
sig-signing-signatures 100;
};
zone "secure.nsec3.example" {
@@ -187,6 +189,8 @@ zone "oldsigs.example" {
allow-update { any; };
auto-dnssec maintain;
sig-validity-interval 10 2;
sig-signing-nodes 1000;
sig-signing-signatures 100;
};
zone "prepub.example" {
+38 -36
View File
@@ -72,12 +72,16 @@ checkjitter () {
_expiretimes=$(freq "$_file" | awk '{print $1}')
_count=0
# Check if we have at least 8 days
# Check if we have at least 5 days
# This number has been tuned for `sig-validity-interval 10 2`, as
# 1. 1. signature expiration dates should be spread out across at most 8 (10-2) days
# 2. we remove first and last day to remove frequency outlier, we are left with 6 (8-2) days
# 3. we substract one more day to allow test pass on day boundaries, etc. leaving us with 5 (6-1) days
for _num in $_expiretimes
do
_count=$((_count+1))
done
if [ "$_count" -lt 8 ]; then
if [ "$_count" -lt 5 ]; then
echo_i "error: not enough categories"
return 1
fi
@@ -103,7 +107,7 @@ checkjitter () {
_low=$((_mean-_limit))
_high=$((_mean+_limit))
# Find outliers.
echo_i "checking whether all frequencies falls into <$_low;$_high> interval"
echo_i "checking whether all frequencies fall into <$_low;$_high> range"
for _num in $_expiretimes
do
if [ $_num -gt $_high ] || [ $_num -lt $_low ]; then
@@ -387,20 +391,26 @@ $RNDCCMD 10.53.0.1 sync 2>&1 | sed 's/^/ns1 /' | cat_i
$RNDCCMD 10.53.0.2 sync 2>&1 | sed 's/^/ns2 /' | cat_i
$RNDCCMD 10.53.0.3 sync 2>&1 | sed 's/^/ns3 /' | cat_i
now="$(TZ=UTC date +%Y%m%d%H%M%S)"
check_expiry() (
$DIG $DIGOPTS AXFR oldsigs.example @10.53.0.3 > dig.out.test$n
nearest_expiration="$(awk '$4 == "RRSIG" { print $9 }' < dig.out.test$n | sort -n | head -1)"
if [ "$nearest_expiration" -le "$now" ]; then
echo_i "failed: $nearest_expiration <= $now"
return 1
fi
)
echo_i "checking expired signatures were updated ($n)"
for i in 1 2 3 4 5 6 7 8 9
do
ret=0
$DIG $DIGOPTS +noauth a.oldsigs.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
$DIG $DIGOPTS +noauth a.oldsigs.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
digcomp dig.out.ns3.test$n dig.out.ns4.test$n || ret=1
grep "flags:.*ad.*QUERY" dig.out.ns4.test$n > /dev/null || ret=1
[ $ret = 0 ] && break
sleep 1
done
retry 10 check_expiry || ret=1
$DIG $DIGOPTS +noauth a.oldsigs.example. @10.53.0.3 a > dig.out.ns3.test$n || ret=1
$DIG $DIGOPTS +noauth a.oldsigs.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
digcomp dig.out.ns3.test$n dig.out.ns4.test$n || ret=1
grep "flags:.*ad.*QUERY" dig.out.ns4.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# Check jitter distribution.
echo_i "checking expired signatures were jittered correctly ($n)"
ret=0
@@ -1027,19 +1037,14 @@ $KEYGEN -a rsasha1 -3 -q -K ns3 jitter.nsec3.example > /dev/null
# Trigger zone signing.
$RNDCCMD 10.53.0.3 sign jitter.nsec3.example. 2>&1 | sed 's/^/ns3 /' | cat_i
# Wait until zone has been signed.
i=0
while [ "$i" -lt 20 ]; do
failed=0
$DIG $DIGOPTS axfr jitter.nsec3.example @10.53.0.3 > dig.out.ns3.test$n || failed=1
grep "NSEC3PARAM" dig.out.ns3.test$n > /dev/null || failed=1
[ $failed -eq 0 ] && break
echo_i "waiting ... ($i)"
sleep $((i/5))
i=$((i+1))
done
[ $failed != 0 ] && echo_i "error: no NSEC3PARAM found in AXFR" && ret=1
check_if_nsec3param_exists() {
$DIG $DIGOPTS NSEC3PARAM jitter.nsec3.example @10.53.0.3 > dig.out.ns3.1.test$n || return 1
grep -q "^jitter\.nsec3\.example\..*NSEC3PARAM" dig.out.ns3.1.test$n || return 1
}
retry_quiet 20 check_if_nsec3param_exists || ret=1
$DIG $DIGOPTS AXFR jitter.nsec3.example @10.53.0.3 > dig.out.ns3.2.test$n || ret=1
# Check jitter distribution.
checkjitter dig.out.ns3.test$n || ret=1
checkjitter dig.out.ns3.2.test$n || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1354,7 +1359,6 @@ $DIG $DIGOPTS @10.53.0.3 sync.example cdnskey > dig.out.ns3.cdnskeytest$n
grep -i "sync.example.*in.cds.*[1-9][0-9]* " dig.out.ns3.cdstest$n > /dev/null || ret=1
grep -i "sync.example.*in.cdnskey.*257 " dig.out.ns3.cdnskeytest$n > /dev/null || ret=1
n=`expr $n + 1`
if [ "$lret" != 0 ]; then ret=$lret; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1389,19 +1393,19 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "setting CDS and CDNSKEY deletion times and calling 'rndc loadkeys'"
$SETTIME -D sync now+2 `cat sync.key` > /dev/null
$SETTIME -D sync now `cat sync.key` > /dev/null
$RNDCCMD 10.53.0.3 loadkeys sync.example | sed 's/^/ns3 /' | cat_i
echo_i "waiting for deletion to occur"
sleep 3
echo_i "checking that the CDS and CDNSKEY are deleted ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.3 sync.example cds > dig.out.ns3.cdstest$n
$DIG $DIGOPTS @10.53.0.3 sync.example cdnskey > dig.out.ns3.cdnskeytest$n
grep -i "sync.example.*in.cds.*[1-9][0-9]* " dig.out.ns3.cdstest$n > /dev/null && ret=1
grep -i "sync.example.*in.cdnskey.*257 " dig.out.ns3.cdnskeytest$n > /dev/null && ret=1
ensure_cds_and_cdnskey_are_deleted() {
$DIG $DIGOPTS @10.53.0.3 sync.example. CDS > dig.out.ns3.cdstest$n || return 1
awk '$1 == "sync.example." && $4 == "CDS" { exit 1; }' dig.out.ns3.cdstest$n || return 1
$DIG $DIGOPTS @10.53.0.3 sync.example. CDNSKEY > dig.out.ns3.cdnskeytest$n || return 1
awk '$1 == "sync.example." && $4 == "CDNSKEY" { exit 1; }' dig.out.ns3.cdnskeytest$n || return 1
}
retry 10 ensure_cds_and_cdnskey_are_deleted || ret=1
n=`expr $n + 1`
if [ "$lret" != 0 ]; then ret=$lret; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1410,7 +1414,6 @@ ret=0
$SETTIME -p Dsync `cat sync.key` > settime.out.$n|| ret=0
grep "SYNC Delete:" settime.out.$n >/dev/null || ret=0
n=`expr $n + 1`
if [ "$lret" != 0 ]; then ret=$lret; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -1419,7 +1422,6 @@ ret=0
$SETTIME -p Psync `cat sync.key` > settime.out.$n|| ret=0
grep "SYNC Publish:" settime.out.$n >/dev/null || ret=0
n=`expr $n + 1`
if [ "$lret" != 0 ]; then ret=$lret; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+1
View File
@@ -752,6 +752,7 @@ if [ -x "$DIG" ] ; then
status=$((status+ret))
fi
n=$((n+1))
echo_i "check that dig +unexpected works ($n)"
ret=0
dig_with_opts @10.53.0.6 +unexpected a a.example > dig.out.test$n || ret=1
+19 -6
View File
@@ -852,6 +852,19 @@ check_signatures() {
fi
}
response_has_cds_for_key() (
awk -v zone="${ZONE%%.}." \
-v ttl="${DNSKEY_TTL}" \
-v qtype="${_qtype}" \
-v keyid="$(key_get "${1}" ID)" \
-v keyalg="${_key_algnum}" \
-v hashalg="2" \
'BEGIN { ret=1; }
$1 == zone && $2 == ttl && $4 == qtype && $5 == keyid && $6 == keyalg && $7 == hashalg { ret=0; exit; }
END { exit ret; }' \
"$2"
)
# Test CDS and CDNSKEY publication.
check_cds() {
@@ -865,24 +878,24 @@ check_cds() {
grep "status: NOERROR" "dig.out.$DIR.test$n" > /dev/null || log_error "mismatch status in DNS response"
if [ "$(key_get KEY1 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY1 STATE_DS)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*$(key_get KEY1 ID).*${_key_algnum}.*2" "dig.out.$DIR.test$n" > /dev/null || log_error "missing ${_qtype} record in response for key $(key_get KEY1 ID)"
response_has_cds_for_key KEY1 "dig.out.$DIR.test$n" || log_error "missing ${_qtype} record in response for key $(key_get KEY1 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
elif [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*$(key_get KEY1 ID).*${_key_algnum}.*2" "dig.out.$DIR.test$n" > /dev/null && log_error "unexpected ${_qtype} record in response for key $(key_get KEY1 ID)"
response_has_cds_for_key KEY1 "dig.out.$DIR.test$n" && log_error "unexpected ${_qtype} record in response for key $(key_get KEY1 ID)"
fi
if [ "$(key_get KEY2 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY2 STATE_DS)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*$(key_get KEY2 ID).*${_key_algnum}.*2" "dig.out.$DIR.test$n" > /dev/null || log_error "missing ${_qtype} record in response for key $(key_get KEY2 ID)"
response_has_cds_for_key KEY2 "dig.out.$DIR.test$n" || log_error "missing ${_qtype} record in response for key $(key_get KEY2 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
elif [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*$(key_get KEY2 ID).*${_key_algnum}.*2" "dig.out.$DIR.test$n" > /dev/null && log_error "unexpected ${_qtype} record in response for key $(key_get KEY2 ID)"
response_has_cds_for_key KEY2 "dig.out.$DIR.test$n" && log_error "unexpected ${_qtype} record in response for key $(key_get KEY2 ID)"
fi
if [ "$(key_get KEY3 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY3 STATE_DS)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*$(key_get KEY3 ID).*${_key_algnum}.*2" "dig.out.$DIR.test$n" > /dev/null || log_error "missing ${_qtype} record in response for key $(key_get KEY3 ID)"
response_has_cds_for_key KEY3 "dig.out.$DIR.test$n" || log_error "missing ${_qtype} record in response for key $(key_get KEY3 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
elif [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*$(key_get KEY3 ID).*${_key_algnum}.*2" "dig.out.$DIR.test$n" > /dev/null && log_error "unexpected ${_qtype} record in response for key $(key_get KEY3 ID)"
response_has_cds_for_key KEY3 "dig.out.$DIR.test$n" && log_error "unexpected ${_qtype} record in response for key $(key_get KEY3 ID)"
fi
test "$ret" -eq 0 || echo_i "failed"
+2 -2
View File
@@ -189,13 +189,13 @@ if [ $status != 0 ]; then
echofail "R:$systest:FAIL"
# Do not clean up - we need the evidence.
else
core_dumps="$(find $systest/ -name 'core*' | sort | tr '\n' ' ')"
core_dumps="$(find $systest/ -name 'core*' -or -name '*.core' | sort | tr '\n' ' ')"
assertion_failures=$(find $systest/ -name named.run | xargs grep "assertion failure" | wc -l)
if [ -n "$core_dumps" ]; then
echoinfo "I:$systest:Test claims success despite crashes: $core_dumps"
echofail "R:$systest:FAIL"
# Do not clean up - we need the evidence.
find "$systest/" -name 'core*' | while read -r coredump; do
find "$systest/" -name 'core*' -or -name '*.core' | while read -r coredump; do
SYSTESTDIR="$systest"
echoinfo "D:$systest:backtrace from $coredump start"
binary=$(gdb --batch --core="$coredump" | sed -ne "s/Core was generated by \`//;s/ .*'.$//p;")
+2 -2
View File
@@ -291,6 +291,8 @@ print_yaml(dns_dtdata_t *dt) {
}
if (dt->msg != NULL) {
dt->msg->indent.count = 2;
dt->msg->indent.string = " ";
printf(" %s:\n", ((dt->type & DNS_DTTYPE_QUERY) != 0)
? "query_message_data"
: "response_message_data");
@@ -327,8 +329,6 @@ main(int argc, char *argv[]) {
break;
case 'y':
yaml = true;
dns_master_indentstr = " ";
dns_master_indent = 2;
break;
default:
usage();
+2 -2
View File
@@ -248,9 +248,9 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (yaml) {
dns_master_indentstr = " ";
dns_master_indent = 3;
styleflags |= DNS_STYLEFLAG_YAML;
response->indent.string = " ";
response->indent.count = 3;
} else {
if (display_comments) {
styleflags |= DNS_STYLEFLAG_COMMENT;
+12 -15
View File
@@ -9,22 +9,22 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Appendix A. Release Notes</title>
<title>Appendix A. Release Notes</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
<link rel="prev" href="Bv9ARM.ch07.html" title="Chapter 7. Troubleshooting">
<link rel="next" href="Bv9ARM.ch09.html" title="Appendix B. A Brief History of the DNS and BIND">
<link rel="prev" href="Bv9ARM.ch07.html" title="Chapter 7. Troubleshooting">
<link rel="next" href="Bv9ARM.ch09.html" title="Appendix B. A Brief History of the DNS and BIND">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Appendix A. Release Notes</th></tr>
<tr><th colspan="3" align="center">Appendix A. Release Notes</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="Bv9ARM.ch07.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="Bv9ARM.ch09.html">Next</a>
<a accesskey="p" href="Bv9ARM.ch07.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="Bv9ARM.ch09.html">Next</a>
</td>
</tr>
</table>
@@ -719,9 +719,6 @@
<a name="relnotes_thanks"></a>Thank You</h3></div></div></div>
<p>
Thank you to everyone who assisted us in making this release possible.
If you would like to contribute to ISC to assist us in continuing to
make quality open source software, please visit our donations page at
<a class="link" href="https://www.isc.org/donate/" target="_top">https://www.isc.org/donate/</a>.
</p>
</div>
</div>
@@ -731,15 +728,15 @@
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="Bv9ARM.ch07.html">Prev</a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="Bv9ARM.ch09.html">Next</a>
<a accesskey="p" href="Bv9ARM.ch07.html">Prev</a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="Bv9ARM.ch09.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 7. Troubleshooting </td>
<td width="40%" align="left" valign="top">Chapter 7. Troubleshooting </td>
<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
<td width="40%" align="right" valign="top"> Appendix B. A Brief History of the <acronym class="acronym">DNS</acronym> and <acronym class="acronym">BIND</acronym>
<td width="40%" align="right" valign="top"> Appendix B. A Brief History of the <acronym class="acronym">DNS</acronym> and <acronym class="acronym">BIND</acronym>
</td>
</tr>
</table>
-3
View File
@@ -677,9 +677,6 @@
<a name="relnotes_thanks"></a>Thank You</h3></div></div></div>
<p>
Thank you to everyone who assisted us in making this release possible.
If you would like to contribute to ISC to assist us in continuing to
make quality open source software, please visit our donations page at
<a class="link" href="https://www.isc.org/donate/" target="_top">https://www.isc.org/donate/</a>.
</p>
</div>
</div>
+1 -4
View File
@@ -347,7 +347,4 @@ policy.
Thank You
Thank you to everyone who assisted us in making this release possible. If
you would like to contribute to ISC to assist us in continuing to make
quality open source software, please visit our donations page at https://
www.isc.org/donate/.
Thank you to everyone who assisted us in making this release possible.
+40 -45
View File
@@ -252,8 +252,8 @@ struct dns_adbentry {
unsigned char to4096; /* Our max. */
uint8_t mode;
uint32_t quota;
uint32_t active;
atomic_uint_fast32_t quota;
atomic_uint_fast32_t active;
double atr;
/*
@@ -1832,9 +1832,9 @@ new_adbentry(dns_adb_t *adb) {
e->srtt = (isc_random_uniform(0x1f)) + 1;
e->lastage = 0;
e->expires = 0;
e->active = 0;
atomic_init(&e->active, 0);
e->mode = 0;
e->quota = adb->quota;
atomic_init(&e->quota, adb->quota);
e->atr = 0.0;
ISC_LIST_INIT(e->lameinfo);
ISC_LINK_INIT(e, plink);
@@ -2161,8 +2161,10 @@ log_quota(dns_adbentry_t *entry, const char *fmt, ...) {
isc_netaddr_format(&netaddr, addrbuf, sizeof(addrbuf));
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_ADB,
ISC_LOG_INFO, "adb: quota %s (%u/%u): %s",
addrbuf, entry->active, entry->quota, msgbuf);
ISC_LOG_INFO,
"adb: quota %s (%" PRIuFAST32 "/%" PRIuFAST32 "): %s",
addrbuf, atomic_load_relaxed(&entry->active),
atomic_load_relaxed(&entry->quota), msgbuf);
}
static void
@@ -2185,9 +2187,7 @@ copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find,
INSIST(bucket != DNS_ADB_INVALIDBUCKET);
LOCK(&adb->entrylocks[bucket]);
if (entry->quota != 0 &&
entry->active >= entry->quota)
{
if (dns_adbentry_overquota(entry)) {
find->options |=
(DNS_ADBFIND_LAMEPRUNED|
DNS_ADBFIND_OVERQUOTA);
@@ -2225,9 +2225,7 @@ copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find,
INSIST(bucket != DNS_ADB_INVALIDBUCKET);
LOCK(&adb->entrylocks[bucket]);
if (entry->quota != 0 &&
entry->active >= entry->quota)
{
if (dns_adbentry_overquota(entry)) {
find->options |=
(DNS_ADBFIND_LAMEPRUNED|
DNS_ADBFIND_OVERQUOTA);
@@ -2787,9 +2785,8 @@ dns_adb_detach(dns_adb_t **adbx) {
adb = *adbx;
*adbx = NULL;
INSIST(adb->erefcnt > 0);
LOCK(&adb->reflock);
INSIST(adb->erefcnt > 0);
adb->erefcnt--;
need_exit_check = (adb->erefcnt == 0 && adb->irefcnt == 0);
UNLOCK(&adb->reflock);
@@ -3395,10 +3392,13 @@ dump_adb(dns_adb_t *adb, FILE *f, bool debug, isc_stdtime_t now) {
fprintf(f, "; [edns success/4096 timeout/1432 timeout/1232 timeout/"
"512 timeout]\n");
fprintf(f, "; [plain success/timeout]\n;\n");
if (debug)
if (debug) {
LOCK(&adb->reflock);
fprintf(f, "; addr %p, erefcnt %u, irefcnt %u, finds out %u\n",
adb, adb->erefcnt, adb->irefcnt,
isc_mempool_getallocated(adb->nhmp));
UNLOCK(&adb->reflock);
}
/*
* In TSAN mode we need to lock the locks individually, as TSAN
@@ -3534,8 +3534,8 @@ dump_entry(FILE *f, dns_adb_t *adb, dns_adbentry_t *entry,
fprintf(f, " [ttl %d]", (int)(entry->expires - now));
if (adb != NULL && adb->quota != 0 && adb->atr_freq != 0) {
fprintf(f, " [atr %0.2f] [quota %u]",
entry->atr, entry->quota);
fprintf(f, " [atr %0.2f] [quota %" PRIuFAST32 "]",
entry->atr, atomic_load_relaxed(&entry->quota));
}
fprintf(f, "\n");
@@ -4257,21 +4257,25 @@ maybe_adjust_quota(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
addr->entry->atr = ISC_CLAMP(addr->entry->atr, 0.0, 1.0);
if (addr->entry->atr < adb->atr_low && addr->entry->mode > 0) {
addr->entry->quota = adb->quota *
quota_adj[--addr->entry->mode] / 10000;
log_quota(addr->entry, "atr %0.2f, quota increased to %u",
addr->entry->atr, addr->entry->quota);
uint_fast32_t new_quota =
adb->quota * quota_adj[--addr->entry->mode] / 10000;
atomic_store_release(&addr->entry->quota,
ISC_MIN(1, new_quota));
log_quota(addr->entry, "atr %0.2f, quota increased to %"
PRIuFAST32,
addr->entry->atr,
new_quota);
} else if (addr->entry->atr > adb->atr_high &&
addr->entry->mode < (QUOTA_ADJ_SIZE - 1)) {
addr->entry->quota = adb->quota *
quota_adj[++addr->entry->mode] / 10000;
log_quota(addr->entry, "atr %0.2f, quota decreased to %u",
addr->entry->atr, addr->entry->quota);
uint_fast32_t new_quota =
adb->quota * quota_adj[++addr->entry->mode] / 10000;
atomic_store_release(&addr->entry->quota,
ISC_MIN(1, new_quota));
log_quota(addr->entry, "atr %0.2f, quota decreased to %"
PRIuFAST32,
addr->entry->atr,
new_quota);
}
/* Ensure we don't drop to zero */
if (addr->entry->quota == 0)
addr->entry->quota = 1;
}
#define EDNSTOS 3U
@@ -4773,34 +4777,25 @@ dns_adb_setquota(dns_adb_t *adb, uint32_t quota, uint32_t freq,
bool
dns_adbentry_overquota(dns_adbentry_t *entry) {
REQUIRE(DNS_ADBENTRY_VALID(entry));
return (entry->quota != 0 && entry->active >= entry->quota);
uint_fast32_t quota = atomic_load_relaxed(&entry->quota);
uint_fast32_t active = atomic_load_acquire(&entry->active);
return (quota != 0 && active >= quota);
}
void
dns_adb_beginudpfetch(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
int bucket;
REQUIRE(DNS_ADB_VALID(adb));
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
addr->entry->active++;
UNLOCK(&adb->entrylocks[bucket]);
INSIST(atomic_fetch_add_relaxed(&addr->entry->active, 1) != UINT32_MAX);
}
void
dns_adb_endudpfetch(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
int bucket;
REQUIRE(DNS_ADB_VALID(adb));
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);
if (addr->entry->active > 0)
addr->entry->active--;
UNLOCK(&adb->entrylocks[bucket]);
INSIST(atomic_fetch_sub_release(&addr->entry->active, 1) != 0);
}
+2 -24
View File
@@ -165,8 +165,7 @@ LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_debug;
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_comment;
/*%
* Similar to dns_master_style_debug but data is indented with
* dns_master_indentstr (defaults to tab).
* Similar to dns_master_style_debug but data is indented with "\t" (tab)
*/
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_indent;
@@ -180,27 +179,6 @@ LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_keyzone;
*/
LIBDNS_EXTERNAL_DATA extern const dns_master_style_t dns_master_style_yaml;
/*%
* The default indent string to prepend lines with when using
* styleflag DNS_STYLEFLAG_INDENT or DNS_STYLEFLAG_YAML.
* This is set to "\t" by default. The indent is repeated
* 'dns_master_indent' times. This precedes everything else
* on the line, including comment characters (;).
*
* XXX: Changing this value at runtime is not thread-safe.
*/
LIBDNS_EXTERNAL_DATA extern const char *dns_master_indentstr;
/*%
* The number of copies of the indent string to put at the beginning
* of the line when using DNS_STYLEFLAG_INDENT or DNS_STYLEFLAG_YAML.
* This is set to 1 by default. It is increased and decreased
* to adjust indentation levels when producing YAML output.
*
* XXX: This is not thread-safe.
*/
LIBDNS_EXTERNAL_DATA extern unsigned int dns_master_indent;
/***
*** Functions
***/
@@ -341,7 +319,7 @@ isc_result_t
dns_master_rdatasettotext(const dns_name_t *owner_name,
dns_rdataset_t *rdataset,
const dns_master_style_t *style,
isc_buffer_t *target);
dns_indent_t *indent, isc_buffer_t *target);
/*%<
* Convert 'rdataset' to text format, storing the result in 'target'.
*
+2
View File
@@ -269,6 +269,8 @@ struct dns_message {
dns_rdatasetorderfunc_t order;
dns_sortlist_arg_t order_arg;
dns_indent_t indent;
};
struct dns_ednsopt {
+5
View File
@@ -388,6 +388,11 @@ typedef enum {
dns_stale_answer_conf
} dns_stale_answer_t;
typedef struct {
const char *string;
size_t count;
} dns_indent_t;
/*
* Functions.
*/
+34 -25
View File
@@ -98,6 +98,7 @@ typedef struct dns_totext_ctx {
uint32_t current_ttl;
bool current_ttl_valid;
dns_ttl_t serve_stale_ttl;
dns_indent_t indent;
} dns_totext_ctx_t;
LIBDNS_EXTERNAL_DATA const dns_master_style_t
@@ -175,7 +176,7 @@ dns_master_style_debug = {
};
/*%
* Similar, but indented (i.e., prepended with dns_master_indentstr).
* Similar, but indented (i.e., prepended with indentctx.string).
*/
LIBDNS_EXTERNAL_DATA const dns_master_style_t
dns_master_style_indent = {
@@ -207,12 +208,6 @@ dns_master_style_yaml = {
24, 32, 40, 48, 80, 8, UINT_MAX
};
/*%
* Default indent string.
*/
LIBDNS_EXTERNAL_DATA const char *dns_master_indentstr = "\t";
LIBDNS_EXTERNAL_DATA unsigned int dns_master_indent = 1;
#define N_SPACES 10
static char spaces[N_SPACES+1] = " ";
@@ -251,6 +246,9 @@ struct dns_dumpctx {
#define NXDOMAIN(x) (((x)->attributes & DNS_RDATASETATTR_NXDOMAIN) != 0)
static const dns_indent_t default_indent = { "\t", 1 };
static const dns_indent_t default_yamlindent = { " ", 1 };
/*%
* Output tabs and spaces to go from column '*current' to
* column 'to', and update '*current' to reflect the new
@@ -317,11 +315,21 @@ indent(unsigned int *current, unsigned int to, int tabwidth,
}
static isc_result_t
totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) {
totext_ctx_init(const dns_master_style_t *style, const dns_indent_t *indentctx,
dns_totext_ctx_t *ctx)
{
isc_result_t result;
REQUIRE(style->tab_width != 0);
if (indentctx == NULL) {
if ((style->flags & DNS_STYLEFLAG_YAML) != 0) {
indentctx = &default_yamlindent;
} else {
indentctx = &default_indent;
}
}
ctx->style = *style;
ctx->class_printed = false;
@@ -347,11 +355,11 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) {
if ((ctx->style.flags & DNS_STYLEFLAG_INDENT) != 0 ||
(ctx->style.flags & DNS_STYLEFLAG_YAML) != 0)
{
unsigned int i, len = strlen(dns_master_indentstr);
for (i = 0; i < dns_master_indent; i++) {
unsigned int i, len = strlen(indentctx->string);
for (i = 0; i < indentctx->count; i++) {
if (isc_buffer_availablelength(&buf) < len)
return (DNS_R_TEXTTOOLONG);
isc_buffer_putstr(&buf, dns_master_indentstr);
isc_buffer_putstr(&buf, indentctx->string);
}
}
@@ -392,6 +400,7 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) {
ctx->current_ttl = 0;
ctx->current_ttl_valid = false;
ctx->serve_stale_ttl = 0;
ctx->indent = indentctx ? *indentctx : default_indent;
return (ISC_R_SUCCESS);
}
@@ -445,8 +454,8 @@ ncache_summary(dns_rdataset_t *rdataset, bool omit_final_dot,
(ctx->style.flags & DNS_STYLEFLAG_YAML) != 0)
{
unsigned int i;
for (i = 0; i < dns_master_indent; i++) {
CHECK(str_totext(dns_master_indentstr,
for (i = 0; i < ctx->indent.count; i++) {
CHECK(str_totext(ctx->indent.string,
target));
}
}
@@ -534,8 +543,8 @@ rdataset_totext(dns_rdataset_t *rdataset,
if ((ctx->style.flags & DNS_STYLEFLAG_INDENT) != 0 ||
(ctx->style.flags & DNS_STYLEFLAG_YAML) != 0)
{
for (i = 0; i < dns_master_indent; i++)
RETERR(str_totext(dns_master_indentstr,
for (i = 0; i < ctx->indent.count; i++)
RETERR(str_totext(ctx->indent.string,
target));
}
@@ -801,7 +810,7 @@ dns_rdataset_totext(dns_rdataset_t *rdataset,
{
dns_totext_ctx_t ctx;
isc_result_t result;
result = totext_ctx_init(&dns_master_style_debug, &ctx);
result = totext_ctx_init(&dns_master_style_debug, NULL, &ctx);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"could not set master file style");
@@ -829,11 +838,11 @@ isc_result_t
dns_master_rdatasettotext(const dns_name_t *owner_name,
dns_rdataset_t *rdataset,
const dns_master_style_t *style,
isc_buffer_t *target)
dns_indent_t *indent, isc_buffer_t *target)
{
dns_totext_ctx_t ctx;
isc_result_t result;
result = totext_ctx_init(style, &ctx);
result = totext_ctx_init(style, indent, &ctx);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"could not set master file style");
@@ -852,7 +861,7 @@ dns_master_questiontotext(const dns_name_t *owner_name,
{
dns_totext_ctx_t ctx;
isc_result_t result;
result = totext_ctx_init(style, &ctx);
result = totext_ctx_init(style, NULL, &ctx);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"could not set master file style");
@@ -1039,8 +1048,8 @@ dump_rdatasets_text(isc_mem_t *mctx, const dns_name_t *name,
(ctx->style.flags & DNS_STYLEFLAG_YAML) != 0)
{
unsigned int j;
for (j = 0; j < dns_master_indent; j++)
fprintf(f, "%s", dns_master_indentstr);
for (j = 0; j < ctx->indent.count; j++)
fprintf(f, "%s", ctx->indent.string);
}
fprintf(f, "; %s\n", dns_trust_totext(rds->trust));
}
@@ -1072,8 +1081,8 @@ dump_rdatasets_text(isc_mem_t *mctx, const dns_name_t *name,
(ctx->style.flags & DNS_STYLEFLAG_YAML) != 0)
{
unsigned int j;
for (j = 0; j < dns_master_indent; j++)
fprintf(f, "%s", dns_master_indentstr);
for (j = 0; j < ctx->indent.count; j++)
fprintf(f, "%s", ctx->indent.string);
}
fprintf(f, "; resign=%s\n", buf);
}
@@ -1493,7 +1502,7 @@ dumpctx_create(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version,
ISC_UNREACHABLE();
}
result = totext_ctx_init(style, &dctx->tctx);
result = totext_ctx_init(style, NULL, &dctx->tctx);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"could not set master file style");
@@ -1935,7 +1944,7 @@ dns_master_dumpnodetostream(isc_mem_t *mctx, dns_db_t *db,
dns_totext_ctx_t ctx;
dns_rdatasetiter_t *rdsiter = NULL;
result = totext_ctx_init(style, &ctx);
result = totext_ctx_init(style, NULL, &ctx);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"could not set master file style");
+34 -20
View File
@@ -428,6 +428,8 @@ msginit(dns_message_t *m) {
m->tkey = 0;
m->rdclass_set = 0;
m->querytsig = NULL;
m->indent.string = "\t";
m->indent.count = 0;
}
static inline void
@@ -3259,8 +3261,8 @@ dns_message_checksig(dns_message_t *msg, dns_view_t *view) {
if ((__flags & DNS_STYLEFLAG_INDENT) == 0ULL && \
(__flags & DNS_STYLEFLAG_YAML) == 0ULL) \
break; \
for (__i = 0; __i < dns_master_indent; __i++) { \
ADD_STRING(target, dns_master_indentstr); \
for (__i = 0; __i < msg->indent.count; __i++) { \
ADD_STRING(target, msg->indent.string); \
} \
} while (0)
@@ -3268,23 +3270,26 @@ isc_result_t
dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
const dns_master_style_t *style,
dns_messagetextflag_t flags,
isc_buffer_t *target) {
isc_buffer_t *target)
{
dns_name_t *name, empty_name;
dns_rdataset_t *rdataset;
isc_result_t result = ISC_R_SUCCESS;
bool seensoa = false;
unsigned int saveindent;
size_t saved_count;
dns_masterstyle_flags_t sflags;
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(target != NULL);
REQUIRE(VALID_SECTION(section));
saveindent = dns_master_indent;
sflags = dns_master_styleflags(style);
if (ISC_LIST_EMPTY(msg->sections[section]))
goto cleanup;
saved_count = msg->indent.count;
if (ISC_LIST_EMPTY(msg->sections[section])) {
goto cleanup;
}
sflags = dns_master_styleflags(style);
INDENT(style);
if ((sflags & DNS_STYLEFLAG_YAML) != 0) {
@@ -3310,7 +3315,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
goto cleanup;
}
if ((sflags & DNS_STYLEFLAG_YAML) != 0) {
dns_master_indent++;
msg->indent.count++;
}
do {
name = NULL;
@@ -3342,6 +3347,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
result = dns_master_rdatasettotext(name,
rdataset,
style,
&msg->indent,
target);
}
if (result != ISC_R_SUCCESS)
@@ -3350,7 +3356,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
result = dns_message_nextname(msg, section);
} while (result == ISC_R_SUCCESS);
if ((sflags & DNS_STYLEFLAG_YAML) != 0) {
dns_master_indent--;
msg->indent.count--;
}
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0 &&
@@ -3363,7 +3369,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
result = ISC_R_SUCCESS;
cleanup:
dns_master_indent = saveindent;
msg->indent.count = saved_count;
return (result);
}
@@ -3479,13 +3485,15 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg,
dns_rdata_t rdata;
isc_buffer_t optbuf;
uint16_t optcode, optlen;
size_t saved_count;
unsigned char *optdata;
unsigned int saveindent = dns_master_indent;
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(target != NULL);
REQUIRE(VALID_PSEUDOSECTION(section));
saved_count = msg->indent.count;
switch (section) {
case DNS_PSEUDOSECTION_OPT:
ps = dns_message_getopt(msg);
@@ -3495,11 +3503,11 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg,
INDENT(style);
ADD_STRING(target, "OPT_PSEUDOSECTION:\n");
dns_master_indent++;
msg->indent.count++;
INDENT(style);
ADD_STRING(target, "EDNS:\n");
dns_master_indent++;
msg->indent.count++;
INDENT(style);
ADD_STRING(target, "version: ");
@@ -3747,7 +3755,8 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg,
}
INDENT(style);
ADD_STRING(target, "TSIG_PSEUDOSECTION:\n");
result = dns_master_rdatasettotext(name, ps, style, target);
result = dns_master_rdatasettotext(name, ps, style,
&msg->indent, target);
ADD_STRING(target, "\n");
goto cleanup;
case DNS_PSEUDOSECTION_SIG0:
@@ -3758,7 +3767,8 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg,
}
INDENT(style);
ADD_STRING(target, "SIG0_PSEUDOSECTION:\n");
result = dns_master_rdatasettotext(name, ps, style, target);
result = dns_master_rdatasettotext(name, ps, style,
&msg->indent, target);
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, "\n");
@@ -3768,7 +3778,7 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg,
result = ISC_R_UNEXPECTED;
cleanup:
dns_master_indent = saveindent;
msg->indent.count = saved_count;
return (result);
}
@@ -3793,9 +3803,11 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
REQUIRE(target != NULL);
REQUIRE(VALID_PSEUDOSECTION(section));
if ((dns_master_styleflags(style) & DNS_STYLEFLAG_YAML) != 0)
if ((dns_master_styleflags(style) & DNS_STYLEFLAG_YAML) != 0) {
return (dns_message_pseudosectiontoyaml(msg, section, style,
flags, target));
}
switch (section) {
case DNS_PSEUDOSECTION_OPT:
ps = dns_message_getopt(msg);
@@ -4039,7 +4051,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
INDENT(style);
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, ";; TSIG PSEUDOSECTION:\n");
result = dns_master_rdatasettotext(name, ps, style, target);
result = dns_master_rdatasettotext(name, ps, style,
&msg->indent, target);
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, "\n");
@@ -4051,7 +4064,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
INDENT(style);
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, ";; SIG0 PSEUDOSECTION:\n");
result = dns_master_rdatasettotext(name, ps, style, target);
result = dns_master_rdatasettotext(name, ps, style,
&msg->indent, target);
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, "\n");
+1 -1
View File
@@ -1086,7 +1086,7 @@ modrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
goto cleanup;
result = dns_master_rdatasettotext(sdlznode->name, rdataset,
style, buffer);
style, NULL, buffer);
if (result != ISC_R_SUCCESS)
goto cleanup;
+2 -2
View File
@@ -429,8 +429,8 @@ totext_test(void **state) {
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&target, buf, BIGBUFLEN);
result = dns_master_rdatasettotext(dns_rootname,
&rdataset, &dns_master_style_debug,
result = dns_master_rdatasettotext(dns_rootname, &rdataset,
&dns_master_style_debug, NULL,
&target);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_buffer_usedlength(&target), 0);
+4 -4
View File
@@ -75,22 +75,22 @@ typedef enum memory_order memory_order;
typedef struct atomic_int_fast32 {
isc_mutex_t m;
int32_t v;
int_fast32_t v;
} atomic_int_fast32_t;
typedef struct atomic_int_fast64 {
isc_mutex_t m;
int64_t v;
int_fast64_t v;
} atomic_int_fast64_t;
typedef struct atomic_uint_fast32 {
isc_mutex_t m;
uint32_t v;
uint_fast32_t v;
} atomic_uint_fast32_t;
typedef struct atomic_uint_fast64 {
isc_mutex_t m;
uint64_t v;
uint_fast64_t v;
} atomic_uint_fast64_t;
typedef struct atomic_uintptr {