mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch 'mnowak/llvm-15-v9_18' into 'v9_18'
[v9_18] Update clang to version 15 See merge request isc-projects/bind9!7133
This commit is contained in:
commit
bc8c055c6d
156 changed files with 1987 additions and 995 deletions
|
|
@ -12,7 +12,7 @@ variables:
|
|||
TEST_PARALLEL_JOBS: 6
|
||||
|
||||
CONFIGURE: ./configure
|
||||
CLANG_VERSION: 14
|
||||
CLANG_VERSION: 15
|
||||
CLANG: "clang-${CLANG_VERSION}"
|
||||
SCAN_BUILD: "scan-build-${CLANG_VERSION}"
|
||||
ASAN_SYMBOLIZER_PATH: "/usr/lib/llvm-${CLANG_VERSION}/bin/llvm-symbolizer"
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
|||
*/
|
||||
cur = ai;
|
||||
while (cur != NULL && cur->ai_canonname == NULL &&
|
||||
cur->ai_next != NULL) {
|
||||
cur->ai_next != NULL)
|
||||
{
|
||||
cur = cur->ai_next;
|
||||
}
|
||||
if (cur != NULL && cur->ai_canonname != NULL &&
|
||||
|
|
@ -407,7 +408,8 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
*/
|
||||
cur = ai;
|
||||
while (cur != NULL && cur->ai_canonname == NULL &&
|
||||
cur->ai_next != NULL) {
|
||||
cur->ai_next != NULL)
|
||||
{
|
||||
cur = cur->ai_next;
|
||||
}
|
||||
if (cur != NULL && cur->ai_canonname != NULL &&
|
||||
|
|
@ -493,7 +495,8 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
|||
*/
|
||||
cur = ai;
|
||||
while (cur != NULL && cur->ai_canonname == NULL &&
|
||||
cur->ai_next != NULL) {
|
||||
cur->ai_next != NULL)
|
||||
{
|
||||
cur = cur->ai_next;
|
||||
}
|
||||
if (cur != NULL && cur->ai_canonname != NULL &&
|
||||
|
|
|
|||
|
|
@ -472,7 +472,8 @@ main(int argc, char **argv) {
|
|||
outputformat = dns_masterformat_raw;
|
||||
rawversion = strtol(outputformatstr + 4, &end, 10);
|
||||
if (end == outputformatstr + 4 || *end != '\0' ||
|
||||
rawversion > 1U) {
|
||||
rawversion > 1U)
|
||||
{
|
||||
fprintf(stderr, "unknown raw format version\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -511,7 +512,8 @@ main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (argc - isc_commandline_index < 1 ||
|
||||
argc - isc_commandline_index > 2) {
|
||||
argc - isc_commandline_index > 2)
|
||||
{
|
||||
usage();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,8 @@ main(int argc, char **argv) {
|
|||
isc_commandline_errprint = false;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, "a:hk:Mmr:qs:y:z:")) !=
|
||||
-1) {
|
||||
-1)
|
||||
{
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
algname = isc_commandline_argument;
|
||||
|
|
|
|||
|
|
@ -458,7 +458,8 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
|
|||
result = dns_rdataset_next(rdataset))
|
||||
{
|
||||
if ((rdataset->attributes &
|
||||
DNS_RDATASETATTR_NEGATIVE) != 0) {
|
||||
DNS_RDATASETATTR_NEGATIVE) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -482,7 +483,8 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
|
|||
} else {
|
||||
dns_indent_t indent = { " ", 2 };
|
||||
if (!yaml && (rdataset->attributes &
|
||||
DNS_RDATASETATTR_NEGATIVE) != 0) {
|
||||
DNS_RDATASETATTR_NEGATIVE) != 0)
|
||||
{
|
||||
isc_buffer_putstr(&target, "; ");
|
||||
}
|
||||
result = dns_master_rdatasettotext(
|
||||
|
|
@ -784,7 +786,8 @@ load_keys(const cfg_obj_t *keys, dns_client_t *client) {
|
|||
keylist = cfg_listelt_value(elt);
|
||||
|
||||
for (elt2 = cfg_list_first(keylist); elt2 != NULL;
|
||||
elt2 = cfg_list_next(elt2)) {
|
||||
elt2 = cfg_list_next(elt2))
|
||||
{
|
||||
key = cfg_listelt_value(elt2);
|
||||
CHECK(key_fromconfig(key, client));
|
||||
}
|
||||
|
|
@ -943,7 +946,8 @@ addserver(dns_client_t *client) {
|
|||
result = ISC_R_SUCCESS;
|
||||
for (cur = res; cur != NULL; cur = cur->ai_next) {
|
||||
if (cur->ai_family != AF_INET &&
|
||||
cur->ai_family != AF_INET6) {
|
||||
cur->ai_family != AF_INET6)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
sa = isc_mem_get(mctx, sizeof(*sa));
|
||||
|
|
@ -1443,7 +1447,8 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||
warn("extra query type");
|
||||
}
|
||||
if (rdtype == dns_rdatatype_ixfr ||
|
||||
rdtype == dns_rdatatype_axfr) {
|
||||
rdtype == dns_rdatatype_axfr)
|
||||
{
|
||||
fatal("Transfer not supported");
|
||||
}
|
||||
qtype = rdtype;
|
||||
|
|
@ -1522,7 +1527,8 @@ preparse_args(int argc, char **argv) {
|
|||
|
||||
/* Look for dash value option. */
|
||||
if (strpbrk(option, dash_opts) != &option[0] ||
|
||||
strlen(option) > 1U) {
|
||||
strlen(option) > 1U)
|
||||
{
|
||||
/* Error or value in option. */
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1560,13 +1566,15 @@ parse_args(int argc, char **argv) {
|
|||
} else if (argv[0][0] == '-') {
|
||||
if (argc <= 1) {
|
||||
if (dash_option(&argv[0][1], NULL,
|
||||
&open_type_class)) {
|
||||
&open_type_class))
|
||||
{
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
} else {
|
||||
if (dash_option(&argv[0][1], argv[1],
|
||||
&open_type_class)) {
|
||||
&open_type_class))
|
||||
{
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
|
@ -1585,7 +1593,8 @@ parse_args(int argc, char **argv) {
|
|||
warn("extra query type");
|
||||
}
|
||||
if (rdtype == dns_rdatatype_ixfr ||
|
||||
rdtype == dns_rdatatype_axfr) {
|
||||
rdtype == dns_rdatatype_axfr)
|
||||
{
|
||||
fatal("Transfer not supported");
|
||||
}
|
||||
qtype = rdtype;
|
||||
|
|
|
|||
|
|
@ -701,7 +701,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
flags |= DNS_MESSAGETEXTFLAG_NOCOMMENTS;
|
||||
}
|
||||
if (query->lookup->onesoa &&
|
||||
query->lookup->rdtype == dns_rdatatype_axfr) {
|
||||
query->lookup->rdtype == dns_rdatatype_axfr)
|
||||
{
|
||||
flags |= (query->msg_count == 0) ? DNS_MESSAGETEXTFLAG_ONESOA
|
||||
: DNS_MESSAGETEXTFLAG_OMITSOA;
|
||||
}
|
||||
|
|
@ -1801,7 +1802,8 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||
}
|
||||
for (num = 0;
|
||||
num < sizeof(opcodetext) / sizeof(opcodetext[0]);
|
||||
num++) {
|
||||
num++)
|
||||
{
|
||||
if (strcasecmp(opcodetext[num], value) == 0) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -2077,7 +2079,8 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
|
|||
switch (cmd[2]) {
|
||||
case 's':
|
||||
if (!plus_tls_options(cmd, value, state,
|
||||
lookup)) {
|
||||
lookup))
|
||||
{
|
||||
goto invalid_option;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2418,7 +2421,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
result = dns_rdatatype_fromtext(
|
||||
&rdtype, (isc_textregion_t *)&tr);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
rdtype == dns_rdatatype_ixfr) {
|
||||
rdtype == dns_rdatatype_ixfr)
|
||||
{
|
||||
result = DNS_R_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
|
@ -2491,7 +2495,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||
}
|
||||
*need_clone = true;
|
||||
if (get_reverse(textname, sizeof(textname), value, false) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
strlcpy((*lookup)->textname, textname,
|
||||
sizeof((*lookup)->textname));
|
||||
debug("looking up %s", (*lookup)->textname);
|
||||
|
|
@ -2673,7 +2678,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
|
|||
}
|
||||
if (batchfp != NULL) {
|
||||
while (fgets(batchline, sizeof(batchline), batchfp) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
debug("config line %s", batchline);
|
||||
bargc = split_batchline(batchline, bargv, 62,
|
||||
".digrc argv");
|
||||
|
|
@ -2765,7 +2771,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
|
|||
&rdtype,
|
||||
(isc_textregion_t *)&tr);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
rdtype == dns_rdatatype_ixfr) {
|
||||
rdtype == dns_rdatatype_ixfr)
|
||||
{
|
||||
fprintf(stderr, ";; Warning, "
|
||||
"ixfr requires "
|
||||
"a "
|
||||
|
|
@ -2805,7 +2812,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
|
|||
lookup->rdtype = rdtype;
|
||||
lookup->rdtypeset = true;
|
||||
if (rdtype ==
|
||||
dns_rdatatype_axfr) {
|
||||
dns_rdatatype_axfr)
|
||||
{
|
||||
lookup->section_question =
|
||||
plusquest;
|
||||
lookup->comments =
|
||||
|
|
@ -2813,7 +2821,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
|
|||
}
|
||||
if (rdtype ==
|
||||
dns_rdatatype_any &&
|
||||
!lookup->tcp_mode_set) {
|
||||
!lookup->tcp_mode_set)
|
||||
{
|
||||
lookup->tcp_mode = true;
|
||||
}
|
||||
lookup->ixfr_serial = false;
|
||||
|
|
|
|||
|
|
@ -497,7 +497,8 @@ get_server_list(irs_resconf_t *resconf) {
|
|||
debug("get_server_list()");
|
||||
servers = irs_resconf_getnameservers(resconf);
|
||||
for (sa = ISC_LIST_HEAD(*servers); sa != NULL;
|
||||
sa = ISC_LIST_NEXT(sa, link)) {
|
||||
sa = ISC_LIST_NEXT(sa, link))
|
||||
{
|
||||
int pf = isc_sockaddr_pf(sa);
|
||||
isc_netaddr_t na;
|
||||
isc_result_t result;
|
||||
|
|
@ -1936,7 +1937,8 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
|
|||
dns_rdata_ns_t ns;
|
||||
|
||||
if (query->lookup->trace_root &&
|
||||
query->lookup->nsfound >= MXSERV) {
|
||||
query->lookup->nsfound >= MXSERV)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1957,7 +1959,8 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
|
|||
cancel_lookup(query->lookup);
|
||||
lookup->doing_xfr = false;
|
||||
if (!lookup->trace_root &&
|
||||
section == DNS_SECTION_ANSWER) {
|
||||
section == DNS_SECTION_ANSWER)
|
||||
{
|
||||
lookup->trace = false;
|
||||
} else {
|
||||
lookup->trace = query->lookup->trace;
|
||||
|
|
@ -2808,7 +2811,8 @@ _cancel_lookup(dig_lookup_t *lookup, const char *file, unsigned int line) {
|
|||
query->lookup);
|
||||
query->canceled = true;
|
||||
if (query->readhandle != NULL &&
|
||||
!isc_nm_is_http_handle(query->readhandle)) {
|
||||
!isc_nm_is_http_handle(query->readhandle))
|
||||
{
|
||||
isc_nm_cancelread(query->readhandle);
|
||||
}
|
||||
query_detach(&query);
|
||||
|
|
@ -2884,7 +2888,8 @@ get_create_tls_context(dig_query_t *query, const bool is_https,
|
|||
}
|
||||
|
||||
if (query->lookup->tls_key_file_set &&
|
||||
query->lookup->tls_cert_file_set) {
|
||||
query->lookup->tls_cert_file_set)
|
||||
{
|
||||
result = isc_tlsctx_load_certificate(
|
||||
ctx, query->lookup->tls_key_file,
|
||||
query->lookup->tls_cert_file);
|
||||
|
|
@ -2974,7 +2979,8 @@ start_tcp(dig_query_t *query) {
|
|||
if (tls_mode) {
|
||||
port = 853;
|
||||
} else if (query->lookup->https_mode &&
|
||||
!query->lookup->http_plain) {
|
||||
!query->lookup->http_plain)
|
||||
{
|
||||
port = 443;
|
||||
} else if (query->lookup->https_mode) {
|
||||
port = 80;
|
||||
|
|
@ -3040,7 +3046,8 @@ start_tcp(dig_query_t *query) {
|
|||
|
||||
if (!specified_source) {
|
||||
if ((isc_sockaddr_pf(&query->sockaddr) == AF_INET) &&
|
||||
have_ipv4) {
|
||||
have_ipv4)
|
||||
{
|
||||
isc_sockaddr_any(&localaddr);
|
||||
} else {
|
||||
isc_sockaddr_any6(&localaddr);
|
||||
|
|
@ -3736,13 +3743,15 @@ check_for_more_data(dig_lookup_t *lookup, dig_query_t *query,
|
|||
* it's an SOA
|
||||
*/
|
||||
if ((!query->first_soa_rcvd) &&
|
||||
(rdata.type != dns_rdatatype_soa)) {
|
||||
(rdata.type != dns_rdatatype_soa))
|
||||
{
|
||||
puts("; Transfer failed. "
|
||||
"Didn't start with SOA answer.");
|
||||
return (true);
|
||||
}
|
||||
if ((!query->second_rr_rcvd) &&
|
||||
(rdata.type != dns_rdatatype_soa)) {
|
||||
(rdata.type != dns_rdatatype_soa))
|
||||
{
|
||||
query->second_rr_rcvd = true;
|
||||
query->second_rr_serial = 0;
|
||||
debug("got the second rr as nonsoa");
|
||||
|
|
@ -4312,7 +4321,8 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
|
|||
}
|
||||
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0 && !l->ignore &&
|
||||
!l->tcp_mode) {
|
||||
!l->tcp_mode)
|
||||
{
|
||||
if (l->cookie == NULL && l->sendcookie && msg->opt != NULL) {
|
||||
process_opt(l, msg);
|
||||
}
|
||||
|
|
@ -4444,7 +4454,8 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
|
|||
|
||||
if (!l->doing_xfr || l->xfr_q == query) {
|
||||
if (msg->rcode == dns_rcode_nxdomain &&
|
||||
(l->origin != NULL || l->need_search)) {
|
||||
(l->origin != NULL || l->need_search))
|
||||
{
|
||||
if (!next_origin(l) || showsearch) {
|
||||
dighost_printmessage(query, &b, msg, true);
|
||||
dighost_received(isc_buffer_usedlength(&b),
|
||||
|
|
@ -4679,7 +4690,8 @@ cancel_all(void) {
|
|||
current_lookup);
|
||||
q->canceled = true;
|
||||
if (q->readhandle != NULL &&
|
||||
!isc_nm_is_http_handle(q->readhandle)) {
|
||||
!isc_nm_is_http_handle(q->readhandle))
|
||||
{
|
||||
isc_nm_cancelread(q->readhandle);
|
||||
}
|
||||
query_detach(&q);
|
||||
|
|
|
|||
|
|
@ -533,7 +533,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
}
|
||||
|
||||
if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_AUTHORITY]) &&
|
||||
!short_form) {
|
||||
!short_form)
|
||||
{
|
||||
printf("\n");
|
||||
result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY",
|
||||
true, query);
|
||||
|
|
@ -542,7 +543,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||
}
|
||||
}
|
||||
if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_ADDITIONAL]) &&
|
||||
!short_form) {
|
||||
!short_form)
|
||||
{
|
||||
printf("\n");
|
||||
result = printsection(msg, DNS_SECTION_ADDITIONAL, "ADDITIONAL",
|
||||
true, query);
|
||||
|
|
@ -596,10 +598,12 @@ pre_parse_args(int argc, char **argv) {
|
|||
{
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
|
||||
} else if (strcasecmp("record",
|
||||
isc_commandline_argument) == 0) {
|
||||
isc_commandline_argument) == 0)
|
||||
{
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
|
||||
} else if (strcasecmp("usage",
|
||||
isc_commandline_argument) == 0) {
|
||||
isc_commandline_argument) == 0)
|
||||
{
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -710,7 +714,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
|
|||
break;
|
||||
case 't':
|
||||
if (strncasecmp(isc_commandline_argument, "ixfr=", 5) ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
rdtype = dns_rdatatype_ixfr;
|
||||
/* XXXMPA add error checking */
|
||||
serial = strtoul(isc_commandline_argument + 5,
|
||||
|
|
@ -729,7 +734,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
|
|||
isc_commandline_argument);
|
||||
}
|
||||
if (!lookup->rdtypeset ||
|
||||
lookup->rdtype != dns_rdatatype_axfr) {
|
||||
lookup->rdtype != dns_rdatatype_axfr)
|
||||
{
|
||||
lookup->rdtype = rdtype;
|
||||
}
|
||||
lookup->rdtypeset = true;
|
||||
|
|
@ -773,7 +779,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
|
|||
FALLTHROUGH;
|
||||
case 'a':
|
||||
if (!lookup->rdtypeset ||
|
||||
lookup->rdtype != dns_rdatatype_axfr) {
|
||||
lookup->rdtype != dns_rdatatype_axfr)
|
||||
{
|
||||
lookup->rdtype = dns_rdatatype_any;
|
||||
}
|
||||
list_type = dns_rdatatype_any;
|
||||
|
|
|
|||
|
|
@ -636,7 +636,8 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
|
|||
NULL);
|
||||
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != DNS_R_FROMWILDCARD) {
|
||||
result != DNS_R_FROMWILDCARD)
|
||||
{
|
||||
vbprintf(1,
|
||||
"skip RRSIG by key %d:"
|
||||
" verification failed: %s\n",
|
||||
|
|
@ -1085,7 +1086,8 @@ main(int argc, char *argv[]) {
|
|||
* optional, so that it works just like sed(1).
|
||||
*/
|
||||
if (isc_commandline_argument ==
|
||||
argv[isc_commandline_index - 1]) {
|
||||
argv[isc_commandline_index - 1])
|
||||
{
|
||||
isc_commandline_index--;
|
||||
inplace = "";
|
||||
} else {
|
||||
|
|
@ -1177,7 +1179,8 @@ main(int argc, char *argv[]) {
|
|||
fatal("missing RRSIG CDNSKEY records for %s", namestr);
|
||||
}
|
||||
if (dns_rdataset_isassociated(&cds_set) &&
|
||||
!dns_rdataset_isassociated(&cds_sig)) {
|
||||
!dns_rdataset_isassociated(&cds_sig))
|
||||
{
|
||||
fatal("missing RRSIG CDS records for %s", namestr);
|
||||
}
|
||||
|
||||
|
|
@ -1200,7 +1203,8 @@ main(int argc, char *argv[]) {
|
|||
if (dns_rdataset_isassociated(&cdnskey_set)) {
|
||||
vbprintf(1, "verify CDNSKEY signature(s)\n");
|
||||
if (!signed_loose(matching_sigs(old_key_tbl, &cdnskey_set,
|
||||
&cdnskey_sig))) {
|
||||
&cdnskey_sig)))
|
||||
{
|
||||
fatal("could not validate child CDNSKEY RRset for %s",
|
||||
namestr);
|
||||
}
|
||||
|
|
@ -1208,7 +1212,8 @@ main(int argc, char *argv[]) {
|
|||
if (dns_rdataset_isassociated(&cds_set)) {
|
||||
vbprintf(1, "verify CDS signature(s)\n");
|
||||
if (!signed_loose(
|
||||
matching_sigs(old_key_tbl, &cds_set, &cds_sig))) {
|
||||
matching_sigs(old_key_tbl, &cds_set, &cds_sig)))
|
||||
{
|
||||
fatal("could not validate child CDS RRset for %s",
|
||||
namestr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -559,7 +559,8 @@ main(int argc, char **argv) {
|
|||
flags |= DNS_KEYOWNER_ZONE;
|
||||
} else if ((options & DST_TYPE_KEY) != 0) { /* KEY */
|
||||
if (strcasecmp(nametype, "host") == 0 ||
|
||||
strcasecmp(nametype, "entity") == 0) {
|
||||
strcasecmp(nametype, "entity") == 0)
|
||||
{
|
||||
flags |= DNS_KEYOWNER_ENTITY;
|
||||
} else if (strcasecmp(nametype, "user") == 0) {
|
||||
flags |= DNS_KEYOWNER_USER;
|
||||
|
|
@ -586,7 +587,8 @@ main(int argc, char **argv) {
|
|||
if (protocol == -1) {
|
||||
protocol = DNS_KEYPROTO_DNSSEC;
|
||||
} else if ((options & DST_TYPE_KEY) == 0 &&
|
||||
protocol != DNS_KEYPROTO_DNSSEC) {
|
||||
protocol != DNS_KEYPROTO_DNSSEC)
|
||||
{
|
||||
fatal("invalid DNSKEY protocol: %d", protocol);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -254,7 +254,8 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
|
|||
cfg_obj_t *kconfig = cfg_listelt_value(element);
|
||||
kasp = NULL;
|
||||
if (strcmp(cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
|
||||
name) != 0) {
|
||||
name) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +392,8 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
|||
|
||||
if (!ctx->oldstyle && ctx->prepub > 0) {
|
||||
if (ctx->setpub && ctx->setact &&
|
||||
(ctx->activate - ctx->prepub) < ctx->publish) {
|
||||
(ctx->activate - ctx->prepub) < ctx->publish)
|
||||
{
|
||||
fatal("Activation and publication dates "
|
||||
"are closer together than the\n\t"
|
||||
"prepublication interval.");
|
||||
|
|
@ -727,7 +729,8 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
|
|||
|
||||
if (ctx->setdel) {
|
||||
if (ctx->setinact &&
|
||||
ctx->deltime < ctx->inactive) {
|
||||
ctx->deltime < ctx->inactive)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: warning: Key is "
|
||||
"scheduled to be deleted "
|
||||
|
|
@ -981,7 +984,8 @@ main(int argc, char **argv) {
|
|||
ctx.protocol = strtol(isc_commandline_argument, &endp,
|
||||
10);
|
||||
if (*endp != '\0' || ctx.protocol < 0 ||
|
||||
ctx.protocol > 255) {
|
||||
ctx.protocol > 255)
|
||||
{
|
||||
fatal("-p must be followed by a number "
|
||||
"[0..255]");
|
||||
}
|
||||
|
|
@ -997,7 +1001,8 @@ main(int argc, char **argv) {
|
|||
ctx.signatory = strtol(isc_commandline_argument, &endp,
|
||||
10);
|
||||
if (*endp != '\0' || ctx.signatory < 0 ||
|
||||
ctx.signatory > 15) {
|
||||
ctx.signatory > 15)
|
||||
{
|
||||
fatal("-s must be followed by a number "
|
||||
"[0..15]");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,8 @@ main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (argc < isc_commandline_index + 1 ||
|
||||
argv[isc_commandline_index] == NULL) {
|
||||
argv[isc_commandline_index] == NULL)
|
||||
{
|
||||
fatal("The key file name was not specified");
|
||||
}
|
||||
if (argc > isc_commandline_index + 1) {
|
||||
|
|
|
|||
|
|
@ -544,7 +544,8 @@ main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (argc < isc_commandline_index + 1 ||
|
||||
argv[isc_commandline_index] == NULL) {
|
||||
argv[isc_commandline_index] == NULL)
|
||||
{
|
||||
fatal("The key file name was not specified");
|
||||
}
|
||||
if (argc > isc_commandline_index + 1) {
|
||||
|
|
@ -552,7 +553,8 @@ main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if ((setgoal || setds || setdnskey || setkrrsig || setzrrsig) &&
|
||||
!write_state) {
|
||||
!write_state)
|
||||
{
|
||||
fatal("Options -g, -d, -k, -r and -z require -s to be set");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -362,7 +362,8 @@ keythatsigned_unlocked(dns_rdata_rrsig_t *rrsig) {
|
|||
dns_dnsseckey_t *key;
|
||||
|
||||
for (key = ISC_LIST_HEAD(keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
if (rrsig->keyid == dst_key_id(key->key) &&
|
||||
rrsig->algorithm == dst_key_alg(key->key) &&
|
||||
dns_name_equal(&rrsig->signer, dst_key_name(key->key)))
|
||||
|
|
@ -564,7 +565,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
|||
"invalid validity period\n",
|
||||
sigstr);
|
||||
} else if (key == NULL && !future &&
|
||||
expecttofindkey(&rrsig.signer)) {
|
||||
expecttofindkey(&rrsig.signer))
|
||||
{
|
||||
/* rrsig is dropped and not replaced */
|
||||
vbprintf(2,
|
||||
"\trrsig by %s dropped - "
|
||||
|
|
@ -575,7 +577,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
|||
vbprintf(2, "\trrsig by %s %s - dnskey not found\n",
|
||||
keep ? "retained" : "dropped", sigstr);
|
||||
} else if (!dns_dnssec_keyactive(key->key, now) &&
|
||||
remove_inactkeysigs) {
|
||||
remove_inactkeysigs)
|
||||
{
|
||||
keep = false;
|
||||
vbprintf(2, "\trrsig by %s dropped - key inactive\n",
|
||||
sigstr);
|
||||
|
|
@ -676,7 +679,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
|||
}
|
||||
|
||||
for (key = ISC_LIST_HEAD(keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
if (nowsignedby[key->index]) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -698,7 +702,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
|||
curr = ISC_LIST_NEXT(curr, link))
|
||||
{
|
||||
if (dst_key_alg(key->key) !=
|
||||
dst_key_alg(curr->key)) {
|
||||
dst_key_alg(curr->key))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (REVOKE(curr->key)) {
|
||||
|
|
@ -709,7 +714,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
|||
}
|
||||
}
|
||||
if (isksk(key) || !have_ksk ||
|
||||
(iszsk(key) && !keyset_kskonly)) {
|
||||
(iszsk(key) && !keyset_kskonly))
|
||||
{
|
||||
signwithkey(name, set, key->key, ttl, add,
|
||||
"signing with dnskey");
|
||||
}
|
||||
|
|
@ -750,7 +756,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
|
|||
DST_NUM_SUCCESSOR,
|
||||
&suc);
|
||||
if (ret != ISC_R_SUCCESS ||
|
||||
dst_key_id(key->key) != suc) {
|
||||
dst_key_id(key->key) != suc)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1203,7 +1210,8 @@ signname(dns_dbnode_t *node, dns_name_t *name) {
|
|||
*/
|
||||
if (isdelegation) {
|
||||
if (rdataset.type != nsec_datatype &&
|
||||
rdataset.type != dns_rdatatype_ds) {
|
||||
rdataset.type != dns_rdatatype_ds)
|
||||
{
|
||||
goto skip;
|
||||
}
|
||||
} else if (rdataset.type == dns_rdatatype_ds) {
|
||||
|
|
@ -1352,7 +1360,8 @@ active_node(dns_dbnode_t *node) {
|
|||
check_result(result, "dns_db_deleterdataset("
|
||||
"rrsig)");
|
||||
} else if (result != ISC_R_NOMORE &&
|
||||
result != ISC_R_SUCCESS) {
|
||||
result != ISC_R_SUCCESS)
|
||||
{
|
||||
fatal("rdataset iteration failed: %s",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
|
|
@ -1433,7 +1442,8 @@ setsoaserial(uint32_t serial, dns_updatemethod_t method) {
|
|||
old_serial = dns_soa_getserial(&rdata);
|
||||
|
||||
if (method == dns_updatemethod_date ||
|
||||
method == dns_updatemethod_unixtime) {
|
||||
method == dns_updatemethod_unixtime)
|
||||
{
|
||||
new_serial = dns_update_soaserial(old_serial, method, &used);
|
||||
} else if (serial != 0 || method == dns_updatemethod_none) {
|
||||
/* Set SOA serial to the value provided. */
|
||||
|
|
@ -1648,10 +1658,12 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
|
|||
!dns_name_issubdomain(name, zonecut)))
|
||||
{
|
||||
if (is_delegation(gdb, gversion, gorigin, name,
|
||||
node, NULL)) {
|
||||
node, NULL))
|
||||
{
|
||||
zonecut = savezonecut(&fzonecut, name);
|
||||
if (!OPTOUT(nsec3flags) ||
|
||||
secure(name, node)) {
|
||||
secure(name, node))
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
} else if (has_dname(gdb, gversion, node)) {
|
||||
|
|
@ -1813,12 +1825,14 @@ remove_records(dns_dbnode_t *node, dns_rdatatype_t which, bool checknsec) {
|
|||
dns_rdataset_disassociate(&rdataset);
|
||||
if (type == which || covers == which) {
|
||||
if (which == dns_rdatatype_nsec && checknsec &&
|
||||
!update_chain) {
|
||||
!update_chain)
|
||||
{
|
||||
fatal("Zone contains NSEC records. Use -u "
|
||||
"to update to NSEC3.");
|
||||
}
|
||||
if (which == dns_rdatatype_nsec3param && checknsec &&
|
||||
!update_chain) {
|
||||
!update_chain)
|
||||
{
|
||||
fatal("Zone contains NSEC3 chains. Use -u "
|
||||
"to update to NSEC.");
|
||||
}
|
||||
|
|
@ -2265,7 +2279,8 @@ rrset_cleanup(dns_name_t *name, dns_rdataset_t *rdataset, dns_diff_t *add,
|
|||
count2++;
|
||||
dns_rdataset_current(&tmprdataset, &rdata2);
|
||||
if (count1 < count2 &&
|
||||
dns_rdata_casecompare(&rdata1, &rdata2) == 0) {
|
||||
dns_rdata_casecompare(&rdata1, &rdata2) == 0)
|
||||
{
|
||||
vbprintf(2, "removing duplicate at %s/%s\n",
|
||||
namestr, typestr);
|
||||
result = dns_difftuple_create(
|
||||
|
|
@ -2432,14 +2447,16 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
|||
continue;
|
||||
}
|
||||
if (is_delegation(gdb, gversion, gorigin, nextname,
|
||||
nextnode, &nsttl)) {
|
||||
nextnode, &nsttl))
|
||||
{
|
||||
zonecut = savezonecut(&fzonecut, nextname);
|
||||
remove_sigs(nextnode, true, 0);
|
||||
if (generateds) {
|
||||
add_ds(nextname, nextnode, nsttl);
|
||||
}
|
||||
if (OPTOUT(nsec3flags) &&
|
||||
!secure(nextname, nextnode)) {
|
||||
!secure(nextname, nextnode))
|
||||
{
|
||||
dns_db_detachnode(gdb, &nextnode);
|
||||
result = dns_dbiterator_next(dbiter);
|
||||
continue;
|
||||
|
|
@ -2573,10 +2590,12 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
|
|||
continue;
|
||||
}
|
||||
if (is_delegation(gdb, gversion, gorigin, nextname,
|
||||
nextnode, NULL)) {
|
||||
nextnode, NULL))
|
||||
{
|
||||
zonecut = savezonecut(&fzonecut, nextname);
|
||||
if (OPTOUT(nsec3flags) &&
|
||||
!secure(nextname, nextnode)) {
|
||||
!secure(nextname, nextnode))
|
||||
{
|
||||
dns_db_detachnode(gdb, &nextnode);
|
||||
result = dns_dbiterator_next(dbiter);
|
||||
continue;
|
||||
|
|
@ -2754,7 +2773,8 @@ loadexplicitkeys(char *keyfiles[], int n, bool setksk) {
|
|||
|
||||
/* Skip any duplicates */
|
||||
for (key = ISC_LIST_HEAD(keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
if (dst_key_id(key->key) == dst_key_id(newkey) &&
|
||||
dst_key_alg(key->key) == dst_key_alg(newkey))
|
||||
{
|
||||
|
|
@ -3095,7 +3115,8 @@ writeset(const char *prefix, dns_rdatatype_t type) {
|
|||
name = gorigin;
|
||||
|
||||
for (key = ISC_LIST_HEAD(keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
if (REVOKE(key->key)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -3768,7 +3789,8 @@ main(int argc, char *argv[]) {
|
|||
outputformat = dns_masterformat_raw;
|
||||
rawversion = strtol(outputformatstr + 4, &end, 10);
|
||||
if (end == outputformatstr + 4 || *end != '\0' ||
|
||||
rawversion > 1U) {
|
||||
rawversion > 1U)
|
||||
{
|
||||
fprintf(stderr, "unknown raw format version\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -3874,7 +3896,8 @@ main(int argc, char *argv[]) {
|
|||
|
||||
/* Now enumerate the key list */
|
||||
for (key = ISC_LIST_HEAD(keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
key->index = keycount++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -313,7 +313,8 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
|
|||
*/
|
||||
n = strspn(str, "0123456789");
|
||||
if ((n == 8u || n == 14u) &&
|
||||
(str[n] == '\0' || str[n] == '-' || str[n] == '+')) {
|
||||
(str[n] == '\0' || str[n] == '-' || str[n] == '+'))
|
||||
{
|
||||
char timestr[15];
|
||||
|
||||
strlcpy(timestr, str, sizeof(timestr));
|
||||
|
|
@ -329,7 +330,8 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) {
|
|||
base = val;
|
||||
str += n;
|
||||
} else if (n == 10u &&
|
||||
(str[n] == '\0' || str[n] == '-' || str[n] == '+')) {
|
||||
(str[n] == '\0' || str[n] == '-' || str[n] == '+'))
|
||||
{
|
||||
base = strtoll(str, &endp, 0);
|
||||
str += 10;
|
||||
} else if (strncmp(str, "now", 3) == 0) {
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
|
|||
* Reverse of 192.0.0.170 or 192.0.0.171 maps to ipv4only.arpa.
|
||||
*/
|
||||
if ((v[0] == 170 || v[0] == 171) && v[1] == 0 && v[2] == 0 &&
|
||||
v[3] == 192) {
|
||||
v[3] == 192)
|
||||
{
|
||||
return (dns_sdb_putrdata(lookup, dns_rdatatype_ptr, 3600,
|
||||
ipv4only, sizeof(ipv4only)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -396,7 +396,8 @@ named_checknames_get(const cfg_obj_t **maps, const char *const names[],
|
|||
for (i = 0; maps[i] != NULL; i++) {
|
||||
checknames = NULL;
|
||||
if (cfg_map_get(maps[i], "check-names", &checknames) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
/*
|
||||
* Zone map entry is not a list.
|
||||
*/
|
||||
|
|
@ -412,7 +413,8 @@ named_checknames_get(const cfg_obj_t **maps, const char *const names[],
|
|||
|
||||
for (size_t j = 0; names[j] != NULL; j++) {
|
||||
if (strcasecmp(cfg_obj_asstring(type),
|
||||
names[j]) == 0) {
|
||||
names[j]) == 0)
|
||||
{
|
||||
*obj = cfg_tuple_get(value,
|
||||
"mode");
|
||||
return (ISC_R_SUCCESS);
|
||||
|
|
@ -485,7 +487,8 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
|
|||
if (strcasecmp(str, "primary") == 0 || strcasecmp(str, "master") == 0) {
|
||||
ztype = dns_zone_primary;
|
||||
} else if (strcasecmp(str, "secondary") == 0 ||
|
||||
strcasecmp(str, "slave") == 0) {
|
||||
strcasecmp(str, "slave") == 0)
|
||||
{
|
||||
ztype = dns_zone_secondary;
|
||||
} else if (strcasecmp(str, "mirror") == 0) {
|
||||
ztype = dns_zone_mirror;
|
||||
|
|
@ -623,7 +626,8 @@ getremotesdef(const cfg_obj_t *cctx, const char *list, const char *name,
|
|||
while (elt != NULL) {
|
||||
obj = cfg_listelt_value(elt);
|
||||
if (strcasecmp(cfg_obj_asstring(cfg_tuple_get(obj, "name")),
|
||||
name) == 0) {
|
||||
name) == 0)
|
||||
{
|
||||
*ret = obj;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -470,7 +470,8 @@ control_recvmessage(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
|
|||
|
||||
if (isccc_cc_lookupuint32(conn->ctrl, "_tim", &sent) == ISC_R_SUCCESS) {
|
||||
if ((sent + CLOCKSKEW) < conn->now ||
|
||||
(sent - CLOCKSKEW) > conn->now) {
|
||||
(sent - CLOCKSKEW) > conn->now)
|
||||
{
|
||||
log_invalid(&conn->ccmsg, ISCCC_R_CLOCKSKEW);
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -914,7 +915,8 @@ get_key_info(const cfg_obj_t *config, const cfg_obj_t *control,
|
|||
control_keylist = cfg_tuple_get(control, "keys");
|
||||
|
||||
if (!cfg_obj_isvoid(control_keylist) &&
|
||||
cfg_list_first(control_keylist) != NULL) {
|
||||
cfg_list_first(control_keylist) != NULL)
|
||||
{
|
||||
result = cfg_map_get(config, "key", &global_keylist);
|
||||
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -198,7 +198,8 @@ named_log_setdefaultsslkeylogfile(isc_logconfig_t *lcfg) {
|
|||
isc_result_t result;
|
||||
|
||||
if (sslkeylogfile_path == NULL ||
|
||||
strcmp(sslkeylogfile_path, "config") == 0) {
|
||||
strcmp(sslkeylogfile_path, "config") == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -439,7 +439,8 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
|
|||
arglen = (int)(end - arg);
|
||||
for (def = defs; def->name != NULL; def++) {
|
||||
if (arglen == (int)strlen(def->name) &&
|
||||
memcmp(arg, def->name, arglen) == 0) {
|
||||
memcmp(arg, def->name, arglen) == 0)
|
||||
{
|
||||
if (def->value == 0) {
|
||||
clear = true;
|
||||
}
|
||||
|
|
@ -493,14 +494,16 @@ static void
|
|||
list_hmac_algorithms(isc_buffer_t *b) {
|
||||
isc_buffer_t sb = *b;
|
||||
for (dst_algorithm_t i = DST_ALG_HMAC_FIRST; i <= DST_ALG_HMAC_LAST;
|
||||
i++) {
|
||||
i++)
|
||||
{
|
||||
if (dst_algorithm_supported(i)) {
|
||||
isc_buffer_putstr(b, " ");
|
||||
isc_buffer_putstr(b, dst_hmac_algorithm_totext(i));
|
||||
}
|
||||
}
|
||||
for (unsigned char *s = isc_buffer_used(&sb); s != isc_buffer_used(b);
|
||||
s++) {
|
||||
s++)
|
||||
{
|
||||
*s = toupper(*s);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -970,7 +970,8 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
|
|||
* warning, but do not prevent further keys from being processed.
|
||||
*/
|
||||
if (!dns_resolver_algorithm_supported(view->resolver, keyname,
|
||||
ds.algorithm)) {
|
||||
ds.algorithm))
|
||||
{
|
||||
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING,
|
||||
"ignoring %s for '%s': algorithm is disabled",
|
||||
initializing ? "initial-key" : "static-key",
|
||||
|
|
@ -1012,7 +1013,8 @@ load_view_keys(const cfg_obj_t *keys, dns_view_t *view, bool managed,
|
|||
keylist = cfg_listelt_value(elt);
|
||||
|
||||
for (elt2 = cfg_list_first(keylist); elt2 != NULL;
|
||||
elt2 = cfg_list_next(elt2)) {
|
||||
elt2 = cfg_list_next(elt2))
|
||||
{
|
||||
CHECK(process_key(cfg_listelt_value(elt2), secroots,
|
||||
keyname, view, managed));
|
||||
}
|
||||
|
|
@ -1080,7 +1082,8 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
|
|||
|
||||
/* We don't need trust anchors for the _bind view */
|
||||
if (strcmp(view->name, "_bind") == 0 &&
|
||||
view->rdclass == dns_rdataclass_chaos) {
|
||||
view->rdclass == dns_rdataclass_chaos)
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -2063,7 +2066,8 @@ conf_dnsrps_get(const cfg_obj_t **sub_obj, const cfg_obj_t **maps,
|
|||
if (cfg_obj_isvoid(*sub_obj)) {
|
||||
*sub_obj = NULL;
|
||||
if (maps != NULL &&
|
||||
ISC_R_SUCCESS != named_config_get(maps, name, sub_obj)) {
|
||||
ISC_R_SUCCESS != named_config_get(maps, name, sub_obj))
|
||||
{
|
||||
*sub_obj = NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -2209,7 +2213,8 @@ conf_dnsrps(dns_view_t *view, const cfg_obj_t **maps, bool nsip_enabled,
|
|||
* statement in the view and the general options.
|
||||
*/
|
||||
if (conf_dnsrps_get(&obj, maps, rpz_obj, "dnsrps-options", &ctx) &&
|
||||
obj != NULL) {
|
||||
obj != NULL)
|
||||
{
|
||||
conf_dnsrps_sadd(&ctx, " %s\n", cfg_obj_asstring(obj));
|
||||
}
|
||||
|
||||
|
|
@ -2286,7 +2291,8 @@ configure_rpz_zone(dns_view_t *view, const cfg_listelt_t *element,
|
|||
|
||||
obj = cfg_tuple_get(rpz_obj, "recursive-only");
|
||||
if (cfg_obj_isvoid(obj) ? recursive_only_default
|
||||
: cfg_obj_asboolean(obj)) {
|
||||
: cfg_obj_asboolean(obj))
|
||||
{
|
||||
view->rpzs->p.no_rd_ok &= ~DNS_RPZ_ZBIT(zone->num);
|
||||
} else {
|
||||
view->rpzs->p.no_rd_ok |= DNS_RPZ_ZBIT(zone->num);
|
||||
|
|
@ -2329,9 +2335,11 @@ configure_rpz_zone(dns_view_t *view, const cfg_listelt_t *element,
|
|||
}
|
||||
if (!view->rpzs->p.dnsrps_enabled) {
|
||||
for (rpz_num = 0; rpz_num < view->rpzs->p.num_zones - 1;
|
||||
++rpz_num) {
|
||||
++rpz_num)
|
||||
{
|
||||
if (dns_name_equal(&view->rpzs->zones[rpz_num]->origin,
|
||||
&zone->origin)) {
|
||||
&zone->origin))
|
||||
{
|
||||
cfg_obj_log(rpz_obj, named_g_lctx,
|
||||
DNS_RPZ_ERROR_LEVEL,
|
||||
"duplicate '%s'", str);
|
||||
|
|
@ -2627,10 +2635,12 @@ configure_rpz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t **maps,
|
|||
*/
|
||||
if (*old_rpz_okp) {
|
||||
if (old != NULL &&
|
||||
memcmp(&old->p, &zones->p, sizeof(zones->p)) != 0) {
|
||||
memcmp(&old->p, &zones->p, sizeof(zones->p)) != 0)
|
||||
{
|
||||
*old_rpz_okp = false;
|
||||
} else if ((old == NULL || old->rps_cstr == NULL) !=
|
||||
(zones->rps_cstr == NULL)) {
|
||||
(zones->rps_cstr == NULL))
|
||||
{
|
||||
*old_rpz_okp = false;
|
||||
} else if (old != NULL && zones->rps_cstr != NULL &&
|
||||
strcmp(old->rps_cstr, zones->rps_cstr) != 0)
|
||||
|
|
@ -2690,7 +2700,8 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
|
|||
result = dns_fwdtable_find(ev->view->fwdtable, name, NULL,
|
||||
&dnsforwarders);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dnsforwarders->fwdpolicy == dns_fwdpolicy_only) {
|
||||
dnsforwarders->fwdpolicy == dns_fwdpolicy_only)
|
||||
{
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
|
||||
"catz: catz_addmodzone_taskaction: "
|
||||
|
|
@ -2773,7 +2784,8 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
|
|||
}
|
||||
goto cleanup;
|
||||
} else if (result != ISC_R_NOTFOUND &&
|
||||
result != DNS_R_PARTIALMATCH) {
|
||||
result != DNS_R_PARTIALMATCH)
|
||||
{
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
|
||||
"catz: error \"%s\" while trying to "
|
||||
|
|
@ -3494,7 +3506,8 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
|||
obj = NULL;
|
||||
(void)cfg_map_get(zoptions, "type", &obj);
|
||||
if (obj != NULL &&
|
||||
strcasecmp(cfg_obj_asstring(obj), "forward") == 0) {
|
||||
strcasecmp(cfg_obj_asstring(obj), "forward") == 0)
|
||||
{
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(zoptions, "forward", &obj);
|
||||
if (obj == NULL) {
|
||||
|
|
@ -3544,7 +3557,8 @@ create_empty_zone(dns_zone_t *pzone, dns_name_t *name, dns_view_t *view,
|
|||
}
|
||||
|
||||
if (pzone != NULL &&
|
||||
dns_zone_gettype(pzone) != dns_zone_primary) {
|
||||
dns_zone_gettype(pzone) != dns_zone_primary)
|
||||
{
|
||||
pzone = NULL;
|
||||
}
|
||||
if (pzone != NULL && dns_zone_getfile(pzone) != NULL) {
|
||||
|
|
@ -4678,7 +4692,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
}
|
||||
if (pview != NULL) {
|
||||
if (!cache_reusable(pview, view,
|
||||
zero_no_soattl)) {
|
||||
zero_no_soattl))
|
||||
{
|
||||
isc_log_write(named_g_lctx,
|
||||
NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER,
|
||||
|
|
@ -4806,7 +4821,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
max_adb_size = 1; /* Force minimum. */
|
||||
}
|
||||
if (view != nsc->primaryview &&
|
||||
max_adb_size > MAX_ADB_SIZE_FOR_CACHESHARE) {
|
||||
max_adb_size > MAX_ADB_SIZE_FOR_CACHESHARE)
|
||||
{
|
||||
max_adb_size = MAX_ADB_SIZE_FOR_CACHESHARE;
|
||||
if (!nsc->adbsizeadjusted) {
|
||||
dns_adb_setadbsize(nsc->primaryview->adb,
|
||||
|
|
@ -5289,7 +5305,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
NULL, actx, named_g_mctx, &view->cacheonacl));
|
||||
|
||||
if (strcmp(view->name, "_bind") != 0 &&
|
||||
view->rdclass != dns_rdataclass_chaos) {
|
||||
view->rdclass != dns_rdataclass_chaos)
|
||||
{
|
||||
/* named.conf only */
|
||||
CHECK(configure_view_acl(vconfig, config, NULL,
|
||||
"allow-recursion", NULL, actx,
|
||||
|
|
@ -5715,7 +5732,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
(void)named_config_get(maps, "empty-zones-enable", &obj);
|
||||
(void)named_config_get(maps, "disable-empty-zone", &disablelist);
|
||||
if (obj == NULL && disablelist == NULL &&
|
||||
view->rdclass == dns_rdataclass_in) {
|
||||
view->rdclass == dns_rdataclass_in)
|
||||
{
|
||||
empty_zones_enable = view->recursion;
|
||||
} else if (view->rdclass == dns_rdataclass_in) {
|
||||
if (obj != NULL) {
|
||||
|
|
@ -5800,7 +5818,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
*/
|
||||
CHECK(dns_name_fromstring(name, empty, 0, NULL));
|
||||
if (disablelist != NULL &&
|
||||
on_disable_list(disablelist, name)) {
|
||||
on_disable_list(disablelist, name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -5890,7 +5909,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
|||
|
||||
name = dns_fixedname_initname(&fixed);
|
||||
for (ipv4only_zone = 0; ipv4only_zone < ARRAY_SIZE(zones);
|
||||
ipv4only_zone++) {
|
||||
ipv4only_zone++)
|
||||
{
|
||||
dns_forwarders_t *dnsforwarders = NULL;
|
||||
|
||||
CHECK(dns_name_fromstring(
|
||||
|
|
@ -6740,7 +6760,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
|
|||
}
|
||||
|
||||
if (view->catzs != NULL &&
|
||||
dns_catz_get_zone(view->catzs, origin) != NULL) {
|
||||
dns_catz_get_zone(view->catzs, origin) != NULL)
|
||||
{
|
||||
zone_is_catz = true;
|
||||
}
|
||||
|
||||
|
|
@ -9033,7 +9054,8 @@ load_configuration(const char *filename, named_server_t *server,
|
|||
isc_nm_setloadbalancesockets(named_g_netmgr,
|
||||
cfg_obj_asboolean(obj));
|
||||
} else if (loadbalancesockets !=
|
||||
isc_nm_getloadbalancesockets(named_g_netmgr)) {
|
||||
isc_nm_getloadbalancesockets(named_g_netmgr))
|
||||
{
|
||||
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
|
||||
"changing reuseport value requires server restart");
|
||||
}
|
||||
|
|
@ -9696,7 +9718,8 @@ load_configuration(const char *filename, named_server_t *server,
|
|||
sizeof(server->sctx->secret));
|
||||
result = isc_hex_decodestring(str, &b);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != ISC_R_NOSPACE) {
|
||||
result != ISC_R_NOSPACE)
|
||||
{
|
||||
goto cleanup;
|
||||
}
|
||||
first = false;
|
||||
|
|
@ -9707,7 +9730,8 @@ load_configuration(const char *filename, named_server_t *server,
|
|||
sizeof(altsecret->secret));
|
||||
result = isc_hex_decodestring(str, &b);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != ISC_R_NOSPACE) {
|
||||
result != ISC_R_NOSPACE)
|
||||
{
|
||||
isc_mem_put(server->sctx->mctx,
|
||||
altsecret,
|
||||
sizeof(*altsecret));
|
||||
|
|
@ -10120,14 +10144,16 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
|
|||
(void)named_server_saventa(server);
|
||||
|
||||
for (kasp = ISC_LIST_HEAD(server->kasplist); kasp != NULL;
|
||||
kasp = kasp_next) {
|
||||
kasp = kasp_next)
|
||||
{
|
||||
kasp_next = ISC_LIST_NEXT(kasp, link);
|
||||
ISC_LIST_UNLINK(server->kasplist, kasp, link);
|
||||
dns_kasp_detach(&kasp);
|
||||
}
|
||||
|
||||
for (view = ISC_LIST_HEAD(server->viewlist); view != NULL;
|
||||
view = view_next) {
|
||||
view = view_next)
|
||||
{
|
||||
view_next = ISC_LIST_NEXT(view, link);
|
||||
ISC_LIST_UNLINK(server->viewlist, view, link);
|
||||
if (flush) {
|
||||
|
|
@ -10193,7 +10219,8 @@ get_matching_view(isc_netaddr_t *srcaddr, isc_netaddr_t *destaddr,
|
|||
view = ISC_LIST_NEXT(view, link))
|
||||
{
|
||||
if (message->rdclass == view->rdclass ||
|
||||
message->rdclass == dns_rdataclass_any) {
|
||||
message->rdclass == dns_rdataclass_any)
|
||||
{
|
||||
const dns_name_t *tsig = NULL;
|
||||
|
||||
*sigresult = dns_message_rechecksig(message, view);
|
||||
|
|
@ -10604,7 +10631,8 @@ next_token(isc_lex_t *lex, isc_buffer_t **text) {
|
|||
}
|
||||
|
||||
if (token.type == isc_tokentype_string ||
|
||||
token.type == isc_tokentype_qstring) {
|
||||
token.type == isc_tokentype_qstring)
|
||||
{
|
||||
return (token.value.as_textregion.base);
|
||||
}
|
||||
|
||||
|
|
@ -11066,10 +11094,12 @@ find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
|
|||
}
|
||||
|
||||
for (elt = cfg_list_first(maplist); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const cfg_obj_t *map = cfg_listelt_value(elt);
|
||||
if (strcasecmp(cfg_obj_asstring(cfg_map_getname(map)), name) ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
return (map);
|
||||
}
|
||||
}
|
||||
|
|
@ -11143,12 +11173,14 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
|
|||
cert = cfg_obj_asstring(certobj);
|
||||
|
||||
if (cfg_map_get(tlsmap, "ca-file", &ca_obj) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
ca_file = cfg_obj_asstring(ca_obj);
|
||||
}
|
||||
|
||||
if (cfg_map_get(tlsmap, "protocols", &tls_proto_list) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
const cfg_listelt_t *proto = NULL;
|
||||
INSIST(tls_proto_list != NULL);
|
||||
for (proto = cfg_list_first(tls_proto_list);
|
||||
|
|
@ -11170,12 +11202,14 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
|
|||
}
|
||||
|
||||
if (cfg_map_get(tlsmap, "dhparam-file", &dhparam_obj) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
dhparam_file = cfg_obj_asstring(dhparam_obj);
|
||||
}
|
||||
|
||||
if (cfg_map_get(tlsmap, "ciphers", &ciphers_obj) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
ciphers = cfg_obj_asstring(ciphers_obj);
|
||||
}
|
||||
|
||||
|
|
@ -11358,7 +11392,8 @@ listenelt_http(const cfg_obj_t *http, const uint16_t family, bool tls,
|
|||
}
|
||||
|
||||
if (cfg_map_get(http, "listener-clients", &cfg_max_clients) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
INSIST(cfg_max_clients != NULL);
|
||||
max_clients = cfg_obj_asuint32(cfg_max_clients);
|
||||
}
|
||||
|
|
@ -11375,7 +11410,8 @@ listenelt_http(const cfg_obj_t *http, const uint16_t family, bool tls,
|
|||
|
||||
if (http != NULL && eplist != NULL) {
|
||||
for (elt = cfg_list_first(eplist); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const cfg_obj_t *ep = cfg_listelt_value(elt);
|
||||
const char *path = cfg_obj_asstring(ep);
|
||||
endpoints[i++] = isc_mem_strdup(mctx, path);
|
||||
|
|
@ -12794,7 +12830,8 @@ named_server_sync(named_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
|
|||
|
||||
arg = next_token(lex, text);
|
||||
if (arg != NULL &&
|
||||
(strcmp(arg, "-clean") == 0 || strcmp(arg, "-clear") == 0)) {
|
||||
(strcmp(arg, "-clean") == 0 || strcmp(arg, "-clear") == 0))
|
||||
{
|
||||
cleanup = true;
|
||||
arg = next_token(lex, text);
|
||||
}
|
||||
|
|
@ -12837,7 +12874,8 @@ named_server_sync(named_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
|
|||
|
||||
view = dns_zone_getview(zone);
|
||||
if (strcmp(view->name, "_default") == 0 ||
|
||||
strcmp(view->name, "_bind") == 0) {
|
||||
strcmp(view->name, "_bind") == 0)
|
||||
{
|
||||
vname = "";
|
||||
sep = "";
|
||||
} else {
|
||||
|
|
@ -12965,7 +13003,8 @@ named_server_freeze(named_server_t *server, bool freeze, isc_lex_t *lex,
|
|||
|
||||
view = dns_zone_getview(mayberaw);
|
||||
if (strcmp(view->name, "_default") == 0 ||
|
||||
strcmp(view->name, "_bind") == 0) {
|
||||
strcmp(view->name, "_bind") == 0)
|
||||
{
|
||||
vname = "";
|
||||
sep = "";
|
||||
} else {
|
||||
|
|
@ -13103,7 +13142,8 @@ nzf_writeconf(const cfg_obj_t *config, dns_view_t *view) {
|
|||
CHECK(add_comment(fp, view->name)); /* force a comment */
|
||||
|
||||
for (elt = ISC_LIST_HEAD(*list); elt != NULL;
|
||||
elt = ISC_LIST_NEXT(elt, link)) {
|
||||
elt = ISC_LIST_NEXT(elt, link))
|
||||
{
|
||||
const cfg_obj_t *zconfig = cfg_listelt_value(elt);
|
||||
|
||||
CHECK(isc_stdio_write("zone ", 5, 1, fp, NULL));
|
||||
|
|
@ -13807,7 +13847,8 @@ delete_zoneconf(dns_view_t *view, cfg_parser_t *pctx, const cfg_obj_t *config,
|
|||
myname = dns_fixedname_initname(&myfixed);
|
||||
|
||||
for (elt = ISC_LIST_HEAD(*list); elt != NULL;
|
||||
elt = ISC_LIST_NEXT(elt, link)) {
|
||||
elt = ISC_LIST_NEXT(elt, link))
|
||||
{
|
||||
const cfg_obj_t *zconf = cfg_listelt_value(elt);
|
||||
const char *zn;
|
||||
cfg_listelt_t *e;
|
||||
|
|
@ -14701,7 +14742,8 @@ find_name_in_list_from_map(const cfg_obj_t *config,
|
|||
if (name1 != NULL) {
|
||||
result = dns_name_fromstring(name2, vname, 0, NULL);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dns_name_equal(name1, name2)) {
|
||||
dns_name_equal(name1, name2))
|
||||
{
|
||||
const cfg_obj_t *zoptions;
|
||||
const cfg_obj_t *typeobj = NULL;
|
||||
zoptions = cfg_tuple_get(obj, "options");
|
||||
|
|
@ -14915,7 +14957,8 @@ named_server_signing(named_server_t *server, isc_lex_t *lex,
|
|||
if (strcasecmp(ptr, "-list") == 0) {
|
||||
list = true;
|
||||
} else if ((strcasecmp(ptr, "-clear") == 0) ||
|
||||
(strcasecmp(ptr, "-clean") == 0)) {
|
||||
(strcasecmp(ptr, "-clean") == 0))
|
||||
{
|
||||
clear = true;
|
||||
ptr = next_token(lex, text);
|
||||
if (ptr == NULL) {
|
||||
|
|
@ -14959,7 +15002,8 @@ named_server_signing(named_server_t *server, isc_lex_t *lex,
|
|||
}
|
||||
|
||||
if (hash > 0xffU || flags > 0xffU ||
|
||||
iter > dns_nsec3_maxiterations()) {
|
||||
iter > dns_nsec3_maxiterations())
|
||||
{
|
||||
return (ISC_R_RANGE);
|
||||
}
|
||||
|
||||
|
|
@ -15550,7 +15594,8 @@ named_server_zonestatus(named_server_t *server, isc_lex_t *lex,
|
|||
|
||||
/* Key refresh time */
|
||||
if (zonetype == dns_zone_primary ||
|
||||
(zonetype == dns_zone_secondary && hasraw)) {
|
||||
(zonetype == dns_zone_secondary && hasraw))
|
||||
{
|
||||
dns_zone_getrefreshkeytime(zone, &refreshkeytime);
|
||||
isc_time_formathttptimestamp(&refreshkeytime, kbuf,
|
||||
sizeof(kbuf));
|
||||
|
|
|
|||
|
|
@ -1463,7 +1463,8 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
|
|||
#endif /* ifdef HAVE_JSON_C */
|
||||
|
||||
if ((DNS_RDATASTATSTYPE_ATTR(type) &
|
||||
DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) == 0) {
|
||||
DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) == 0)
|
||||
{
|
||||
dns_rdatatype_format(DNS_RDATASTATSTYPE_BASE(type), typebuf,
|
||||
sizeof(typebuf));
|
||||
typestr = typebuf;
|
||||
|
|
@ -1535,7 +1536,8 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
|
|||
#endif /* ifdef HAVE_JSON_C */
|
||||
|
||||
if ((DNS_RDATASTATSTYPE_ATTR(type) &
|
||||
DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) != 0) {
|
||||
DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) != 0)
|
||||
{
|
||||
typestr = "NXDOMAIN";
|
||||
} else if ((DNS_RDATASTATSTYPE_ATTR(type) &
|
||||
DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) != 0)
|
||||
|
|
@ -2238,7 +2240,8 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
|
|||
view = ISC_LIST_HEAD(server->viewlist);
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "views"));
|
||||
while (view != NULL &&
|
||||
((flags & (STATS_XML_SERVER | STATS_XML_ZONES)) != 0)) {
|
||||
((flags & (STATS_XML_SERVER | STATS_XML_ZONES)) != 0))
|
||||
{
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "view"));
|
||||
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
|
||||
ISC_XMLCHAR view->name));
|
||||
|
|
@ -2720,7 +2723,8 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
|||
}
|
||||
|
||||
if (json_object_get_object(refresh_counters)->count !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
json_object_object_add(zoneobj,
|
||||
"dnssec-refresh",
|
||||
refresh_counters);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@
|
|||
const cfg_listelt_t *proto = NULL; \
|
||||
INSIST(obj != NULL); \
|
||||
for (proto = cfg_list_first(obj); proto != 0; \
|
||||
proto = cfg_list_next(proto)) { \
|
||||
proto = cfg_list_next(proto)) \
|
||||
{ \
|
||||
const cfg_obj_t *tls_proto_obj = \
|
||||
cfg_listelt_value(proto); \
|
||||
const char *tls_sver = \
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
|
|||
*/
|
||||
algstr = cfg_obj_asstring(algobj);
|
||||
if (named_config_getkeyalgorithm(algstr, &alg, &bits) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
cfg_obj_log(algobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"key '%s': has a "
|
||||
"unsupported algorithm '%s'",
|
||||
|
|
|
|||
|
|
@ -251,7 +251,8 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
str = cfg_obj_asstring(matchtype);
|
||||
CHECK(dns_ssu_mtypefromstring(str, &mtype));
|
||||
if (mtype == dns_ssumatchtype_subdomain &&
|
||||
strcasecmp(str, "zonesub") == 0) {
|
||||
strcasecmp(str, "zonesub") == 0)
|
||||
{
|
||||
usezone = true;
|
||||
}
|
||||
|
||||
|
|
@ -313,7 +314,8 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
r.length = bracket - str;
|
||||
max = strtoul(bracket + 1, &end, 10);
|
||||
if (max > 0xffff || end[0] != /*(*/ ')' ||
|
||||
end[1] != 0) {
|
||||
end[1] != 0)
|
||||
{
|
||||
cfg_obj_log(identity, named_g_lctx,
|
||||
ISC_LOG_ERROR,
|
||||
"'%s' is not a valid count",
|
||||
|
|
@ -454,7 +456,8 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
|||
* there's nothing to do anymore.
|
||||
*/
|
||||
if (ISC_LIST_EMPTY(rdatalist_a->rdata) &&
|
||||
ISC_LIST_EMPTY(rdatalist_aaaa->rdata)) {
|
||||
ISC_LIST_EMPTY(rdatalist_aaaa->rdata))
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -1017,7 +1020,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
|||
* will be needing a master file.
|
||||
*/
|
||||
if (ztype == dns_zone_primary && cpval == default_dbtype &&
|
||||
filename == NULL) {
|
||||
filename == NULL)
|
||||
{
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
|
||||
"zone '%s': 'file' not specified", zname);
|
||||
|
|
|
|||
|
|
@ -860,7 +860,8 @@ setup_system(void) {
|
|||
*/
|
||||
ns_total = 0;
|
||||
for (sa = ISC_LIST_HEAD(*nslist); sa != NULL;
|
||||
sa = ISC_LIST_NEXT(sa, link)) {
|
||||
sa = ISC_LIST_NEXT(sa, link))
|
||||
{
|
||||
switch (sa->type.sa.sa_family) {
|
||||
case AF_INET:
|
||||
if (have_ipv4) {
|
||||
|
|
@ -882,7 +883,8 @@ setup_system(void) {
|
|||
|
||||
i = 0;
|
||||
for (sa = ISC_LIST_HEAD(*nslist); sa != NULL;
|
||||
sa = ISC_LIST_NEXT(sa, link)) {
|
||||
sa = ISC_LIST_NEXT(sa, link))
|
||||
{
|
||||
switch (sa->type.sa.sa_family) {
|
||||
case AF_INET:
|
||||
if (have_ipv4) {
|
||||
|
|
@ -1916,7 +1918,8 @@ parseclass:
|
|||
dns_name_t *bad;
|
||||
|
||||
if (!dns_rdata_checkowner(name, rdata->rdclass, rdata->type,
|
||||
true)) {
|
||||
true))
|
||||
{
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
|
||||
dns_name_format(name, namebuf, sizeof(namebuf));
|
||||
|
|
@ -2182,7 +2185,8 @@ do_next_command(char *cmdline) {
|
|||
return (evaluate_realm(cmdline));
|
||||
}
|
||||
if (strcasecmp(word, "check-names") == 0 ||
|
||||
strcasecmp(word, "checknames") == 0) {
|
||||
strcasecmp(word, "checknames") == 0)
|
||||
{
|
||||
return (evaluate_checknames(cmdline));
|
||||
}
|
||||
if (strcasecmp(word, "gsstsig") == 0) {
|
||||
|
|
@ -2640,7 +2644,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
|
|||
}
|
||||
|
||||
if (rcvmsg->rcode != dns_rcode_noerror &&
|
||||
rcvmsg->rcode != dns_rcode_nxdomain) {
|
||||
rcvmsg->rcode != dns_rcode_nxdomain)
|
||||
{
|
||||
fatal("response to SOA query was unsuccessful");
|
||||
}
|
||||
|
||||
|
|
@ -3131,7 +3136,8 @@ recvgss(isc_task_t *task, isc_event_t *event) {
|
|||
}
|
||||
|
||||
if (rcvmsg->rcode != dns_rcode_noerror &&
|
||||
rcvmsg->rcode != dns_rcode_nxdomain) {
|
||||
rcvmsg->rcode != dns_rcode_nxdomain)
|
||||
{
|
||||
fatal("response to GSS-TSIG query was unsuccessful");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -619,7 +619,8 @@ process_section(const section_filter_t *filter) {
|
|||
}
|
||||
|
||||
if (section == DNS_SECTION_ANSWER ||
|
||||
section == DNS_SECTION_AUTHORITY) {
|
||||
section == DNS_SECTION_AUTHORITY)
|
||||
{
|
||||
message->flags &= ~DNS_MESSAGEFLAG_AD;
|
||||
}
|
||||
}
|
||||
|
|
@ -669,7 +670,8 @@ filter_prep_response_begin(void *arg, void *cbdata, isc_result_t *resp) {
|
|||
result = ns_client_checkaclsilent(qctx->client, NULL,
|
||||
inst->a_acl, true);
|
||||
if (result == ISC_R_SUCCESS && inst->v4_a != NONE &&
|
||||
is_v4_client(qctx->client)) {
|
||||
is_v4_client(qctx->client))
|
||||
{
|
||||
client_state->mode = inst->v4_a;
|
||||
} else if (result == ISC_R_SUCCESS && inst->v6_a != NONE &&
|
||||
is_v6_client(qctx->client))
|
||||
|
|
|
|||
|
|
@ -622,7 +622,8 @@ process_section(const section_filter_t *filter) {
|
|||
}
|
||||
|
||||
if (section == DNS_SECTION_ANSWER ||
|
||||
section == DNS_SECTION_AUTHORITY) {
|
||||
section == DNS_SECTION_AUTHORITY)
|
||||
{
|
||||
message->flags &= ~DNS_MESSAGEFLAG_AD;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -689,7 +689,8 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
|||
(void)cfg_map_get(config, "server", &servers);
|
||||
if (servers != NULL) {
|
||||
for (elt = cfg_list_first(servers); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const char *name = NULL;
|
||||
server = cfg_listelt_value(elt);
|
||||
name = cfg_obj_asstring(
|
||||
|
|
@ -726,7 +727,8 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
|||
} else {
|
||||
DO("get config key list", cfg_map_get(config, "key", &keys));
|
||||
for (elt = cfg_list_first(keys); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const char *name = NULL;
|
||||
|
||||
key = cfg_listelt_value(elt);
|
||||
|
|
@ -941,11 +943,13 @@ main(int argc, char **argv) {
|
|||
break;
|
||||
case 'b':
|
||||
if (inet_pton(AF_INET, isc_commandline_argument, &in) ==
|
||||
1) {
|
||||
1)
|
||||
{
|
||||
isc_sockaddr_fromin(&local4, &in, 0);
|
||||
local4set = true;
|
||||
} else if (inet_pton(AF_INET6, isc_commandline_argument,
|
||||
&in6) == 1) {
|
||||
&in6) == 1)
|
||||
{
|
||||
isc_sockaddr_fromin6(&local6, &in6, 0);
|
||||
local6set = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -520,7 +520,8 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
}
|
||||
|
||||
if (strcmp(name, "too-long") == 0 ||
|
||||
strcmp(zone, "bigcname.domain") == 0) {
|
||||
strcmp(zone, "bigcname.domain") == 0)
|
||||
{
|
||||
for (i = 0; i < 511; i++) {
|
||||
buf[i] = 'x';
|
||||
}
|
||||
|
|
@ -542,7 +543,8 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
}
|
||||
|
||||
if (strcmp(name, "long.name.is.not.there") == 0 &&
|
||||
strcmp(zone, ".") == 0) {
|
||||
strcmp(zone, ".") == 0)
|
||||
{
|
||||
result = state->putrr(lookup, "A", 0, "100.100.100.3");
|
||||
found = true;
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -325,7 +325,8 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
CHECK(dns_db_addrdataset(sampledb->rbtdb, node, version, now, rdataset,
|
||||
options, addedrdataset));
|
||||
if (rdataset->type == dns_rdatatype_a ||
|
||||
rdataset->type == dns_rdatatype_aaaa) {
|
||||
rdataset->type == dns_rdatatype_aaaa)
|
||||
{
|
||||
CHECK(sample_name_fromnode(node, dns_fixedname_name(&name)));
|
||||
CHECK(syncptrs(sampledb->inst, dns_fixedname_name(&name),
|
||||
rdataset, DNS_DIFFOP_ADD));
|
||||
|
|
@ -353,7 +354,8 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
}
|
||||
|
||||
if (rdataset->type == dns_rdatatype_a ||
|
||||
rdataset->type == dns_rdatatype_aaaa) {
|
||||
rdataset->type == dns_rdatatype_aaaa)
|
||||
{
|
||||
CHECK(sample_name_fromnode(node, dns_fixedname_name(&name)));
|
||||
CHECK(syncptrs(sampledb->inst, dns_fixedname_name(&name),
|
||||
rdataset, DNS_DIFFOP_DEL));
|
||||
|
|
|
|||
|
|
@ -293,7 +293,8 @@ main(int argc, char *argv[]) {
|
|||
isc_sockaddr_t *addr4 = NULL, *addr6 = NULL;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, "a:b:es:t:k:K:p:S:")) !=
|
||||
-1) {
|
||||
-1)
|
||||
{
|
||||
switch (ch) {
|
||||
case 't':
|
||||
tr.base = isc_commandline_argument;
|
||||
|
|
@ -310,7 +311,8 @@ main(int argc, char *argv[]) {
|
|||
break;
|
||||
case 'b':
|
||||
if (inet_pton(AF_INET, isc_commandline_argument,
|
||||
&in4) == 1) {
|
||||
&in4) == 1)
|
||||
{
|
||||
if (addr4 != NULL) {
|
||||
fprintf(stderr, "only one local "
|
||||
"address per family "
|
||||
|
|
@ -320,7 +322,8 @@ main(int argc, char *argv[]) {
|
|||
isc_sockaddr_fromin(&a4, &in4, 0);
|
||||
addr4 = &a4;
|
||||
} else if (inet_pton(AF_INET6, isc_commandline_argument,
|
||||
&in6) == 1) {
|
||||
&in6) == 1)
|
||||
{
|
||||
if (addr6 != NULL) {
|
||||
fprintf(stderr, "only one local "
|
||||
"address per family "
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ main(int argc, char **argv) {
|
|||
rsp = NULL;
|
||||
if (!librpz->rsp_create(&emsg, &rsp, NULL, client, true,
|
||||
false) ||
|
||||
rsp == NULL) {
|
||||
rsp == NULL)
|
||||
{
|
||||
fprintf(stderr, "## %s\n", emsg.c);
|
||||
librpz->client_detach(&client);
|
||||
return (1);
|
||||
|
|
|
|||
|
|
@ -202,7 +202,8 @@ main(int argc, char *argv[]) {
|
|||
break;
|
||||
}
|
||||
if (*rp != ' ' && *rp != '\t' && *rp != '\r' &&
|
||||
*rp != '\n') {
|
||||
*rp != '\n')
|
||||
{
|
||||
*wp++ = *rp;
|
||||
len++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -474,7 +474,8 @@ repopulate_buffer:
|
|||
dns_rdataset_next(rdataset);
|
||||
dns_rdata_reset(&rdata);
|
||||
if (strlen("\n") >=
|
||||
isc_buffer_availablelength(buf)) {
|
||||
isc_buffer_availablelength(buf))
|
||||
{
|
||||
goto buftoosmall;
|
||||
}
|
||||
isc_buffer_putstr(buf, "\n");
|
||||
|
|
@ -1887,7 +1888,8 @@ preparse_args(int argc, char **argv) {
|
|||
}
|
||||
/* Look for dash value option. */
|
||||
if (strpbrk(option, dash_opts) != &option[0] ||
|
||||
strlen(option) > 1U) {
|
||||
strlen(option) > 1U)
|
||||
{
|
||||
/* Error or value in option. */
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1974,13 +1976,15 @@ parse_args(bool is_batchfile, int argc, char **argv) {
|
|||
|
||||
if (rc <= 1) {
|
||||
if (dash_option(&rv[0][1], NULL, query, global,
|
||||
&setname)) {
|
||||
&setname))
|
||||
{
|
||||
rc--;
|
||||
rv++;
|
||||
}
|
||||
} else {
|
||||
if (dash_option(&rv[0][1], rv[1], query, global,
|
||||
&setname)) {
|
||||
&setname))
|
||||
{
|
||||
rc--;
|
||||
rv++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -385,7 +385,8 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
|
||||
/* split string into dns data parts. */
|
||||
if (bdbhpt_parse_data(db->log, tmp, &pd) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
goto allnodes_cleanup;
|
||||
}
|
||||
result = db->putnamedrr(allnodes, pd.host, pd.type,
|
||||
|
|
@ -575,7 +576,8 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
|
||||
flags = DB_SET;
|
||||
while ((bdbhptres = data_cursor->c_get(data_cursor, &key, &data,
|
||||
flags)) == 0) {
|
||||
flags)) == 0)
|
||||
{
|
||||
flags = DB_NEXT_DUP;
|
||||
tmp = realloc(tmp, data.size + 1);
|
||||
if (tmp == NULL) {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,8 @@ create_path_helper(char *out, const char *in, config_data_t *cd) {
|
|||
break;
|
||||
}
|
||||
if (strlen((char *)&tmpPtr[i + 1]) <=
|
||||
(unsigned int)cd->splitcnt) {
|
||||
(unsigned int)cd->splitcnt)
|
||||
{
|
||||
break;
|
||||
}
|
||||
i += cd->splitcnt;
|
||||
|
|
@ -386,10 +387,12 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
*/
|
||||
while ((tmpPtr = strrchr(
|
||||
tmpString,
|
||||
cd->pathsep)) != NULL) {
|
||||
cd->pathsep)) != NULL)
|
||||
{
|
||||
if ((strlen(host) +
|
||||
strlen(tmpPtr + 1) + 2) >
|
||||
DIR_NAMEMAX) {
|
||||
DIR_NAMEMAX)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
strcat(host, tmpPtr + 1);
|
||||
|
|
@ -397,7 +400,8 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
tmpPtr[0] = '\0';
|
||||
}
|
||||
if ((strlen(host) + strlen(tmpString) +
|
||||
1) <= DIR_NAMEMAX) {
|
||||
1) <= DIR_NAMEMAX)
|
||||
{
|
||||
strcat(host, tmpString);
|
||||
}
|
||||
}
|
||||
|
|
@ -413,13 +417,15 @@ process_dir(dir_t *dir, void *passback, config_data_t *cd, dlist_t *dir_list,
|
|||
*/
|
||||
while (dir_read(dir) == ISC_R_SUCCESS) {
|
||||
if (strncasecmp(".host", dir->entry.name, 5) ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
/*
|
||||
* handle filesystem's special
|
||||
* wildcard "-"
|
||||
*/
|
||||
if (strcmp((char *)&dir->entry.name[6],
|
||||
"-") == 0) {
|
||||
"-") == 0)
|
||||
{
|
||||
strcpy(host, "*");
|
||||
} else {
|
||||
strncpy(host,
|
||||
|
|
|
|||
|
|
@ -169,7 +169,8 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
while (r++ < rrcount) {
|
||||
record_ref = POPs;
|
||||
if ((!SvROK(record_ref)) ||
|
||||
(SvTYPE(SvRV(record_ref)) != SVt_PVAV)) {
|
||||
(SvTYPE(SvRV(record_ref)) != SVt_PVAV))
|
||||
{
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"DLZ Perl: allnodes for zone %s "
|
||||
"returned an invalid value "
|
||||
|
|
@ -187,7 +188,8 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
|||
rr_data = av_fetch((AV *)record_ref, 3, 0);
|
||||
|
||||
if (rr_name == NULL || rr_type == NULL || rr_ttl == NULL ||
|
||||
rr_data == NULL) {
|
||||
rr_data == NULL)
|
||||
{
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"DLZ Perl: allnodes for zone %s "
|
||||
"returned an array that was missing data",
|
||||
|
|
@ -424,7 +426,8 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
while (r++ < rrcount) {
|
||||
record_ref = POPs;
|
||||
if ((!SvROK(record_ref)) ||
|
||||
(SvTYPE(SvRV(record_ref)) != SVt_PVAV)) {
|
||||
(SvTYPE(SvRV(record_ref)) != SVt_PVAV))
|
||||
{
|
||||
cd->log(ISC_LOG_ERROR, "DLZ Perl: lookup returned an "
|
||||
"invalid value (expected array "
|
||||
"of arrayrefs)!");
|
||||
|
|
|
|||
|
|
@ -265,7 +265,8 @@ dlz_lookup(const char *zone, const char *name, void *dbdata,
|
|||
if (strcmp(cd->record, nrec->name) == 0) {
|
||||
/* We handle authority data in dlz_authority() */
|
||||
if (strcmp(nrec->type, "SOA") == 0 ||
|
||||
strcmp(nrec->type, "NS") == 0) {
|
||||
strcmp(nrec->type, "NS") == 0)
|
||||
{
|
||||
nrec = next;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -641,7 +642,8 @@ fnmatch(const char *pattern, const char *string, int flags) {
|
|||
/* General case, use recursion. */
|
||||
while ((test = *string) != EOS) {
|
||||
if (!fnmatch(pattern, string,
|
||||
flags & ~FNM_PERIOD)) {
|
||||
flags & ~FNM_PERIOD))
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
if (test == '/' && flags & FNM_PATHNAME) {
|
||||
|
|
@ -744,7 +746,8 @@ rangematch(const char *pattern, char test, int flags, char **newp) {
|
|||
}
|
||||
|
||||
if (*pattern == '-' && (c2 = *(pattern + 1)) != EOS &&
|
||||
c2 != ']') {
|
||||
c2 != ']')
|
||||
{
|
||||
pattern += 2;
|
||||
if (c2 == '\\' && !(flags & FNM_NOESCAPE)) {
|
||||
c2 = *pattern++;
|
||||
|
|
|
|||
|
|
@ -110,10 +110,12 @@ main(int argc, char **argv) {
|
|||
usage();
|
||||
}
|
||||
if (strcmp(argv[1], "master") == 0 ||
|
||||
strcmp(argv[1], "primary") == 0) {
|
||||
strcmp(argv[1], "primary") == 0)
|
||||
{
|
||||
zonetype = CFG_ZONE_PRIMARY;
|
||||
} else if (strcmp(argv[1], "slave") == 0 ||
|
||||
strcmp(argv[1], "secondary") == 0) {
|
||||
strcmp(argv[1], "secondary") == 0)
|
||||
{
|
||||
zonetype = CFG_ZONE_SECONDARY;
|
||||
} else if (strcmp(argv[1], "mirror") == 0) {
|
||||
zonetype = CFG_ZONE_MIRROR;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) {
|
|||
|
||||
obj = cfg_tuple_get(ent, "order");
|
||||
if (!cfg_obj_isstring(obj) ||
|
||||
strcasecmp("order", cfg_obj_asstring(obj)) != 0) {
|
||||
strcasecmp("order", cfg_obj_asstring(obj)) != 0)
|
||||
{
|
||||
cfg_obj_log(ent, logctx, ISC_LOG_ERROR,
|
||||
"rrset-order: keyword 'order' missing");
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
|
|
@ -480,14 +481,16 @@ checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
|
|||
}
|
||||
|
||||
if (strcasecmp(aclname, "allow-transfer") == 0 &&
|
||||
cfg_obj_istuple(aclobj)) {
|
||||
cfg_obj_istuple(aclobj))
|
||||
{
|
||||
const cfg_obj_t *obj_port = cfg_tuple_get(
|
||||
cfg_tuple_get(aclobj, "port-transport"), "port");
|
||||
const cfg_obj_t *obj_proto = cfg_tuple_get(
|
||||
cfg_tuple_get(aclobj, "port-transport"), "transport");
|
||||
|
||||
if (cfg_obj_isuint32(obj_port) &&
|
||||
cfg_obj_asuint32(obj_port) >= UINT16_MAX) {
|
||||
cfg_obj_asuint32(obj_port) >= UINT16_MAX)
|
||||
{
|
||||
cfg_obj_log(obj_port, logctx, ISC_LOG_ERROR,
|
||||
"port value '%u' is out of range",
|
||||
|
||||
|
|
@ -968,10 +971,12 @@ find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
|
|||
}
|
||||
|
||||
for (elt = cfg_list_first(maplist); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const cfg_obj_t *map = cfg_listelt_value(elt);
|
||||
if (strcasecmp(cfg_obj_asstring(cfg_map_getname(map)), name) ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
return (map);
|
||||
}
|
||||
}
|
||||
|
|
@ -1040,7 +1045,8 @@ check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
|
|||
|
||||
portobj = cfg_tuple_get(ltup, "port");
|
||||
if (cfg_obj_isuint32(portobj) &&
|
||||
cfg_obj_asuint32(portobj) >= UINT16_MAX) {
|
||||
cfg_obj_asuint32(portobj) >= UINT16_MAX)
|
||||
{
|
||||
cfg_obj_log(portobj, logctx, ISC_LOG_ERROR,
|
||||
"port value '%u' is out of range",
|
||||
|
||||
|
|
@ -1309,7 +1315,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
}
|
||||
|
||||
for (kasp = ISC_LIST_HEAD(list); kasp != NULL;
|
||||
kasp = kasp_next) {
|
||||
kasp = kasp_next)
|
||||
{
|
||||
kasp_next = ISC_LIST_NEXT(kasp, link);
|
||||
ISC_LIST_UNLINK(list, kasp, link);
|
||||
dns_kasp_detach(&kasp);
|
||||
|
|
@ -1523,7 +1530,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
tresult = mustbesecure(obj, symtab, logctx,
|
||||
mctx);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
tresult != ISC_R_SUCCESS) {
|
||||
tresult != ISC_R_SUCCESS)
|
||||
{
|
||||
result = tresult;
|
||||
}
|
||||
}
|
||||
|
|
@ -1672,7 +1680,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
|
||||
usedlength = isc_buffer_usedlength(&b);
|
||||
if (strcasecmp(ccalg, "aes") == 0 &&
|
||||
usedlength != ISC_AES128_KEYLENGTH) {
|
||||
usedlength != ISC_AES128_KEYLENGTH)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"AES cookie-secret must be 128 "
|
||||
"bits");
|
||||
|
|
@ -1709,7 +1718,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
value = cfg_obj_asuint32(obj);
|
||||
}
|
||||
if (value < fstrm[i].min ||
|
||||
(fstrm[i].max != 0U && value > fstrm[i].max)) {
|
||||
(fstrm[i].max != 0U && value > fstrm[i].max))
|
||||
{
|
||||
if (fstrm[i].max != 0U) {
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"%s '%u' out of range (%u..%u)",
|
||||
|
|
@ -1766,7 +1776,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
|
||||
obj2 = cfg_tuple_get(obj, "size");
|
||||
if (obj2 != NULL && !cfg_obj_isvoid(obj2) &&
|
||||
dmode == dns_dtmode_unix) {
|
||||
dmode == dns_dtmode_unix)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"dnstap-output size "
|
||||
"cannot be set with mode unix");
|
||||
|
|
@ -1777,7 +1788,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
|
||||
obj2 = cfg_tuple_get(obj, "versions");
|
||||
if (obj2 != NULL && !cfg_obj_isvoid(obj2) &&
|
||||
dmode == dns_dtmode_unix) {
|
||||
dmode == dns_dtmode_unix)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"dnstap-output versions "
|
||||
"cannot be set with mode unix");
|
||||
|
|
@ -1788,7 +1800,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
|
|||
|
||||
obj2 = cfg_tuple_get(obj, "suffix");
|
||||
if (obj2 != NULL && !cfg_obj_isvoid(obj2) &&
|
||||
dmode == dns_dtmode_unix) {
|
||||
dmode == dns_dtmode_unix)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"dnstap-output suffix "
|
||||
"cannot be set with mode unix");
|
||||
|
|
@ -2124,7 +2137,8 @@ bind9_check_httpserver(const cfg_obj_t *http, isc_log_t *logctx,
|
|||
tresult = cfg_map_get(http, "endpoints", &eps);
|
||||
if (tresult == ISC_R_SUCCESS) {
|
||||
for (elt = cfg_list_first(eps); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const cfg_obj_t *ep = cfg_listelt_value(elt);
|
||||
const char *path = cfg_obj_asstring(ep);
|
||||
if (!isc_nm_http_path_isvalid(path)) {
|
||||
|
|
@ -2546,7 +2560,8 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
|
||||
/* Check for "update-policy local;" */
|
||||
if (cfg_obj_isstring(policy) &&
|
||||
strcmp("local", cfg_obj_asstring(policy)) == 0) {
|
||||
strcmp("local", cfg_obj_asstring(policy)) == 0)
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -2583,7 +2598,8 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
* There is no name field for subzone and dname is void
|
||||
*/
|
||||
if (mtype == dns_ssumatchtype_subdomain &&
|
||||
cfg_obj_isvoid(dname)) {
|
||||
cfg_obj_isvoid(dname))
|
||||
{
|
||||
str = "."; /* Use "." as a replacement. */
|
||||
} else {
|
||||
str = cfg_obj_asstring(dname);
|
||||
|
|
@ -2631,7 +2647,8 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
case dns_ssumatchtype_tcpself:
|
||||
case dns_ssumatchtype_6to4self:
|
||||
if (tresult == ISC_R_SUCCESS &&
|
||||
!dns_name_equal(dns_rootname, name)) {
|
||||
!dns_name_equal(dns_rootname, name))
|
||||
{
|
||||
cfg_obj_log(identity, logctx, ISC_LOG_ERROR,
|
||||
"name field not set to "
|
||||
"placeholder value '.'");
|
||||
|
|
@ -2682,7 +2699,8 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) {
|
|||
r.length = bracket - r.base;
|
||||
max = strtoul(bracket + 1, &end, 10);
|
||||
if (max > 0xffff || end[0] != /*(*/ ')' ||
|
||||
end[1] != 0) {
|
||||
end[1] != 0)
|
||||
{
|
||||
cfg_obj_log(typeobj, logctx,
|
||||
ISC_LOG_ERROR,
|
||||
"'%s' is not a valid count",
|
||||
|
|
@ -2914,7 +2932,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
|
||||
typestr = cfg_obj_asstring(obj);
|
||||
if (strcasecmp(typestr, "master") == 0 ||
|
||||
strcasecmp(typestr, "primary") == 0) {
|
||||
strcasecmp(typestr, "primary") == 0)
|
||||
{
|
||||
ztype = CFG_ZONE_PRIMARY;
|
||||
} else if (strcasecmp(typestr, "slave") == 0 ||
|
||||
strcasecmp(typestr, "secondary") == 0)
|
||||
|
|
@ -3054,7 +3073,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
isc_mem_free(mctx, tmp);
|
||||
}
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
tresult != ISC_R_SUCCESS) {
|
||||
tresult != ISC_R_SUCCESS)
|
||||
{
|
||||
result = tresult;
|
||||
}
|
||||
}
|
||||
|
|
@ -3126,7 +3146,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
const cfg_obj_t *kobj = cfg_tuple_get(
|
||||
cfg_listelt_value(element), "name");
|
||||
if (strcmp(kaspname, cfg_obj_asstring(kobj)) ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
has_dnssecpolicy = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -3511,7 +3532,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
obj = NULL;
|
||||
res1 = cfg_map_get(zoptions, "dnssec-dnskey-kskonly", &obj);
|
||||
if (res1 == ISC_R_SUCCESS && ztype == CFG_ZONE_SECONDARY &&
|
||||
!signing) {
|
||||
!signing)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"dnssec-dnskey-kskonly: requires "
|
||||
"inline-signing when used in secondary "
|
||||
|
|
@ -3537,7 +3559,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
obj = NULL;
|
||||
res1 = cfg_map_get(zoptions, "dnssec-loadkeys-interval", &obj);
|
||||
if (res1 == ISC_R_SUCCESS && ztype == CFG_ZONE_SECONDARY &&
|
||||
!signing) {
|
||||
!signing)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"dnssec-loadkeys-interval: requires "
|
||||
"inline-signing when used in secondary "
|
||||
|
|
@ -3548,7 +3571,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
obj = NULL;
|
||||
res1 = cfg_map_get(zoptions, "update-check-ksk", &obj);
|
||||
if (res1 == ISC_R_SUCCESS && ztype == CFG_ZONE_SECONDARY &&
|
||||
!signing) {
|
||||
!signing)
|
||||
{
|
||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||
"update-check-ksk: requires "
|
||||
"inline-signing when used in secondary "
|
||||
|
|
@ -3583,7 +3607,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
if (obj != NULL && cfg_obj_isstring(obj)) {
|
||||
const char *str = cfg_obj_asstring(obj);
|
||||
for (i = 0; i < sizeof(dialups) / sizeof(dialups[0]);
|
||||
i++) {
|
||||
i++)
|
||||
{
|
||||
if (strcasecmp(dialups[i].name, str) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -3641,7 +3666,8 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
|
|||
cfg_map_get(goptions, "forward", &obj);
|
||||
}
|
||||
if (obj == NULL ||
|
||||
strcasecmp(cfg_obj_asstring(obj), "first") == 0) {
|
||||
strcasecmp(cfg_obj_asstring(obj), "first") == 0)
|
||||
{
|
||||
cfg_obj_log(zconfig, logctx, ISC_LOG_WARNING,
|
||||
"inherited 'forward first;' for "
|
||||
"%s zone '%s' - did you want "
|
||||
|
|
@ -3905,7 +3931,8 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
result = isc_parse_uint16(&digestbits, algorithm + len + 1, 10);
|
||||
if (result == ISC_R_SUCCESS || result == ISC_R_RANGE) {
|
||||
if (result == ISC_R_RANGE ||
|
||||
digestbits > algorithms[i].size) {
|
||||
digestbits > algorithms[i].size)
|
||||
{
|
||||
cfg_obj_log(algobj, logctx, ISC_LOG_ERROR,
|
||||
"key '%s' digest-bits too large "
|
||||
"[%u..%u]",
|
||||
|
|
@ -3924,7 +3951,8 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) {
|
|||
* Recommended minima for hmac algorithms.
|
||||
*/
|
||||
if ((digestbits < (algorithms[i].size / 2U) ||
|
||||
(digestbits < 80U))) {
|
||||
(digestbits < 80U)))
|
||||
{
|
||||
cfg_obj_log(algobj, logctx, ISC_LOG_WARNING,
|
||||
"key '%s' digest-bits too small "
|
||||
"[<%u]",
|
||||
|
|
@ -4513,7 +4541,8 @@ check_trust_anchor(const cfg_obj_t *key, bool managed, unsigned int *flagsp,
|
|||
}
|
||||
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dns_name_equal(keyname, dns_rootname)) {
|
||||
dns_name_equal(keyname, dns_rootname))
|
||||
{
|
||||
/*
|
||||
* Flag any use of a root key, regardless of content.
|
||||
*/
|
||||
|
|
@ -4569,7 +4598,8 @@ check_trust_anchor(const cfg_obj_t *key, bool managed, unsigned int *flagsp,
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dns_name_equal(keyname, dns_rootname)) {
|
||||
dns_name_equal(keyname, dns_rootname))
|
||||
{
|
||||
/*
|
||||
* Flag any use of a root key, regardless of content.
|
||||
*/
|
||||
|
|
@ -4614,7 +4644,8 @@ record_static_keys(isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
for (elt = cfg_list_first(keylist); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const char *initmethod;
|
||||
const cfg_obj_t *init = NULL;
|
||||
const cfg_obj_t *obj = cfg_listelt_value(elt);
|
||||
|
|
@ -4677,7 +4708,8 @@ check_initializing_keys(isc_symtab_t *symtab, const cfg_obj_t *keylist,
|
|||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
for (elt = cfg_list_first(keylist); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const cfg_obj_t *obj = cfg_listelt_value(elt);
|
||||
const cfg_obj_t *init = NULL;
|
||||
const char *str;
|
||||
|
|
@ -4733,7 +4765,8 @@ record_ds_keys(isc_symtab_t *symtab, isc_mem_t *mctx,
|
|||
name = dns_fixedname_initname(&fixed);
|
||||
|
||||
for (elt = cfg_list_first(keylist); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const char *initmethod;
|
||||
const cfg_obj_t *init = NULL;
|
||||
const cfg_obj_t *obj = cfg_listelt_value(elt);
|
||||
|
|
@ -4801,7 +4834,8 @@ check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
|
|||
* and all the DS-style trust anchors.
|
||||
*/
|
||||
for (elt = cfg_list_first(global_ta); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
keylist = cfg_listelt_value(elt);
|
||||
tresult = record_static_keys(statictab, mctx, keylist, logctx,
|
||||
autovalidation);
|
||||
|
|
@ -4816,7 +4850,8 @@ check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
|
|||
}
|
||||
|
||||
for (elt = cfg_list_first(view_ta); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
keylist = cfg_listelt_value(elt);
|
||||
tresult = record_static_keys(statictab, mctx, keylist, logctx,
|
||||
autovalidation);
|
||||
|
|
@ -4831,7 +4866,8 @@ check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
|
|||
}
|
||||
|
||||
for (elt = cfg_list_first(global_tkeys); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
keylist = cfg_listelt_value(elt);
|
||||
tresult = record_static_keys(statictab, mctx, keylist, logctx,
|
||||
autovalidation);
|
||||
|
|
@ -4841,7 +4877,8 @@ check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
|
|||
}
|
||||
|
||||
for (elt = cfg_list_first(view_tkeys); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
keylist = cfg_listelt_value(elt);
|
||||
tresult = record_static_keys(statictab, mctx, keylist, logctx,
|
||||
autovalidation);
|
||||
|
|
@ -4855,7 +4892,8 @@ check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
|
|||
* static keys and the trust-anchors configured with "initial-key".
|
||||
*/
|
||||
for (elt = cfg_list_first(global_ta); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
keylist = cfg_listelt_value(elt);
|
||||
tresult = check_initializing_keys(statictab, keylist, logctx);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
|
|
@ -4864,7 +4902,8 @@ check_ta_conflicts(const cfg_obj_t *global_ta, const cfg_obj_t *view_ta,
|
|||
}
|
||||
|
||||
for (elt = cfg_list_first(view_ta); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
keylist = cfg_listelt_value(elt);
|
||||
tresult = check_initializing_keys(statictab, keylist, logctx);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
|
|
@ -5024,7 +5063,8 @@ check_catz(const cfg_obj_t *catz_obj, const char *viewname, isc_mem_t *mctx,
|
|||
if (primariesobj != NULL && cfg_obj_istuple(primariesobj)) {
|
||||
primariesobj = cfg_tuple_get(obj, "default-masters");
|
||||
if (primariesobj != NULL &&
|
||||
cfg_obj_istuple(primariesobj)) {
|
||||
cfg_obj_istuple(primariesobj))
|
||||
{
|
||||
cfg_obj_log(nameobj, logctx, ISC_LOG_ERROR,
|
||||
"catalog zone '%s'%s%s: "
|
||||
"'default-primaries' and "
|
||||
|
|
@ -5254,7 +5294,8 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
if (voptions != NULL &&
|
||||
check_nonzero(voptions, logctx) != ISC_R_SUCCESS) {
|
||||
check_nonzero(voptions, logctx) != ISC_R_SUCCESS)
|
||||
{
|
||||
result = ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -5306,7 +5347,8 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||
* Global servers can refer to keys in views.
|
||||
*/
|
||||
if (check_servers(config, voptions, symtab, mctx, logctx) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
result = ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -5419,7 +5461,8 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||
}
|
||||
|
||||
if ((flags & ROOT_KSK_2010) != 0 &&
|
||||
(flags & ROOT_KSK_2017) == 0) {
|
||||
(flags & ROOT_KSK_2017) == 0)
|
||||
{
|
||||
cfg_obj_log(check_keys[i], logctx,
|
||||
ISC_LOG_WARNING,
|
||||
"initial-key entry for the root "
|
||||
|
|
@ -5827,7 +5870,8 @@ bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
|
|||
}
|
||||
|
||||
if (bind9_check_parentalagentlists(config, logctx, mctx) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
result = ISC_R_FAILURE;
|
||||
}
|
||||
|
||||
|
|
@ -5990,14 +6034,16 @@ bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
|
|||
const char *aclname;
|
||||
|
||||
for (elt = cfg_list_first(acls); elt != NULL;
|
||||
elt = cfg_list_next(elt)) {
|
||||
elt = cfg_list_next(elt))
|
||||
{
|
||||
const cfg_obj_t *acl = cfg_listelt_value(elt);
|
||||
unsigned int line = cfg_obj_line(acl);
|
||||
unsigned int i;
|
||||
|
||||
aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
|
||||
for (i = 0; i < sizeof(builtin) / sizeof(builtin[0]);
|
||||
i++) {
|
||||
i++)
|
||||
{
|
||||
if (strcasecmp(aclname, builtin[i]) == 0) {
|
||||
{
|
||||
cfg_obj_log(acl, logctx,
|
||||
|
|
@ -6013,7 +6059,8 @@ bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
|
|||
}
|
||||
|
||||
for (elt2 = cfg_list_next(elt); elt2 != NULL;
|
||||
elt2 = cfg_list_next(elt2)) {
|
||||
elt2 = cfg_list_next(elt2))
|
||||
{
|
||||
const cfg_obj_t *acl2 = cfg_listelt_value(elt2);
|
||||
const char *name;
|
||||
name = cfg_obj_asstring(
|
||||
|
|
|
|||
|
|
@ -137,7 +137,8 @@ again:
|
|||
return (ISC_R_FAILURE);
|
||||
}
|
||||
for (tmpai = ai, i = 0; tmpai != NULL && i < addrsize;
|
||||
tmpai = tmpai->ai_next) {
|
||||
tmpai = tmpai->ai_next)
|
||||
{
|
||||
if (tmpai->ai_family != AF_INET && tmpai->ai_family != AF_INET6)
|
||||
{
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -2207,7 +2207,8 @@ copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find,
|
|||
}
|
||||
|
||||
if (!FIND_RETURNLAME(find) &&
|
||||
entry_is_lame(adb, entry, qname, qtype, now)) {
|
||||
entry_is_lame(adb, entry, qname, qtype, now))
|
||||
{
|
||||
find->options |= DNS_ADBFIND_LAMEPRUNED;
|
||||
goto nextv4;
|
||||
}
|
||||
|
|
@ -2242,7 +2243,8 @@ copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find,
|
|||
}
|
||||
|
||||
if (!FIND_RETURNLAME(find) &&
|
||||
entry_is_lame(adb, entry, qname, qtype, now)) {
|
||||
entry_is_lame(adb, entry, qname, qtype, now))
|
||||
{
|
||||
find->options |= DNS_ADBFIND_LAMEPRUNED;
|
||||
goto nextv6;
|
||||
}
|
||||
|
|
@ -2836,7 +2838,8 @@ dns_adb_shutdown(dns_adb_t *adb) {
|
|||
LOCK(&adb->lock);
|
||||
|
||||
if (atomic_compare_exchange_strong(&adb->shutting_down,
|
||||
&(bool){ false }, true)) {
|
||||
&(bool){ false }, true))
|
||||
{
|
||||
isc_mem_clearwater(adb->mctx);
|
||||
/*
|
||||
* Isolate shutdown_names and shutdown_entries calls.
|
||||
|
|
@ -3616,7 +3619,8 @@ print_namehook_list(FILE *f, const char *legend, dns_adb_t *adb,
|
|||
dns_adbnamehook_t *nh;
|
||||
|
||||
for (nh = ISC_LIST_HEAD(*list); nh != NULL;
|
||||
nh = ISC_LIST_NEXT(nh, plink)) {
|
||||
nh = ISC_LIST_NEXT(nh, plink))
|
||||
{
|
||||
if (debug) {
|
||||
fprintf(f, ";\tHook(%s) %p\n", legend, nh);
|
||||
}
|
||||
|
|
@ -3839,7 +3843,8 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
|
|||
fetch = name->fetch_a;
|
||||
name->fetch_a = NULL;
|
||||
} else if (NAME_FETCH_AAAA(name) &&
|
||||
(name->fetch_aaaa->fetch == dev->fetch)) {
|
||||
(name->fetch_aaaa->fetch == dev->fetch))
|
||||
{
|
||||
address_type = DNS_ADBFIND_INET6;
|
||||
fetch = name->fetch_aaaa;
|
||||
name->fetch_aaaa = NULL;
|
||||
|
|
@ -4094,7 +4099,8 @@ dns_adb_marklame(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
|
|||
LOCK(&adb->entrylocks[bucket]);
|
||||
li = ISC_LIST_HEAD(addr->entry->lameinfo);
|
||||
while (li != NULL &&
|
||||
(li->qtype != qtype || !dns_name_equal(qname, &li->qname))) {
|
||||
(li->qtype != qtype || !dns_name_equal(qname, &li->qname)))
|
||||
{
|
||||
li = ISC_LIST_NEXT(li, plink);
|
||||
}
|
||||
if (li != NULL) {
|
||||
|
|
@ -4603,7 +4609,8 @@ dns_adb_flushnames(dns_adb_t *adb, const dns_name_t *name) {
|
|||
bool ret;
|
||||
nextname = ISC_LIST_NEXT(adbname, plink);
|
||||
if (!NAME_DEAD(adbname) &&
|
||||
dns_name_issubdomain(&adbname->name, name)) {
|
||||
dns_name_issubdomain(&adbname->name, name))
|
||||
{
|
||||
ret = kill_name(&adbname,
|
||||
DNS_EVENT_ADBCANCELED);
|
||||
RUNTIME_CHECK(!ret);
|
||||
|
|
|
|||
|
|
@ -271,7 +271,8 @@ dns_badcache_add(dns_badcache_t *bc, const dns_name_t *name,
|
|||
|
||||
count = atomic_fetch_add_relaxed(&bc->count, 1);
|
||||
if ((count > bc->size * 8) ||
|
||||
(count < bc->size * 2 && bc->size > bc->minsize)) {
|
||||
(count < bc->size * 2 && bc->size > bc->minsize))
|
||||
{
|
||||
resize = true;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -176,7 +176,8 @@ bevent_destroy(isc_event_t *event) {
|
|||
bevent = (dns_byaddrevent_t *)event;
|
||||
|
||||
for (name = ISC_LIST_HEAD(bevent->names); name != NULL;
|
||||
name = next_name) {
|
||||
name = next_name)
|
||||
{
|
||||
next_name = ISC_LIST_NEXT(name, link);
|
||||
ISC_LIST_UNLINK(bevent->names, name, link);
|
||||
dns_name_free(name, mctx);
|
||||
|
|
|
|||
|
|
@ -363,28 +363,32 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
|
|||
|
||||
for (size_t i = 0; i < eb->opts.masters.count; i++) {
|
||||
if ((ea->opts.masters.keys[i] == NULL) !=
|
||||
(eb->opts.masters.keys[i] == NULL)) {
|
||||
(eb->opts.masters.keys[i] == NULL))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
if (ea->opts.masters.keys[i] == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (!dns_name_equal(ea->opts.masters.keys[i],
|
||||
eb->opts.masters.keys[i])) {
|
||||
eb->opts.masters.keys[i]))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < eb->opts.masters.count; i++) {
|
||||
if ((ea->opts.masters.tlss[i] == NULL) !=
|
||||
(eb->opts.masters.tlss[i] == NULL)) {
|
||||
(eb->opts.masters.tlss[i] == NULL))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
if (ea->opts.masters.tlss[i] == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (!dns_name_equal(ea->opts.masters.tlss[i],
|
||||
eb->opts.masters.tlss[i])) {
|
||||
eb->opts.masters.tlss[i]))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
|
@ -405,7 +409,8 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
|
|||
|
||||
/* Repeat the above checks with allow_transfer */
|
||||
if ((ea->opts.allow_transfer == NULL) !=
|
||||
(eb->opts.allow_transfer == NULL)) {
|
||||
(eb->opts.allow_transfer == NULL))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
|
@ -571,7 +576,8 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
|
|||
}
|
||||
}
|
||||
if (zt_find_result == ISC_R_SUCCESS ||
|
||||
zt_find_result == DNS_R_PARTIALMATCH) {
|
||||
zt_find_result == DNS_R_PARTIALMATCH)
|
||||
{
|
||||
dns_zone_detach(&zone);
|
||||
}
|
||||
|
||||
|
|
@ -580,7 +586,8 @@ dns_catz_zones_merge(dns_catz_zone_t *target, dns_catz_zone_t *newzone) {
|
|||
(void **)&oentry);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (zt_find_result == ISC_R_SUCCESS &&
|
||||
parentcatz == target) {
|
||||
parentcatz == target)
|
||||
{
|
||||
/*
|
||||
* This means that the zone's unique label
|
||||
* has been changed, in that case we must
|
||||
|
|
@ -1012,7 +1019,8 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
|
|||
isc_result_t result;
|
||||
isc_ht_iter_create(catzs->zones, &iter);
|
||||
for (result = isc_ht_iter_first(iter);
|
||||
result == ISC_R_SUCCESS;) {
|
||||
result == ISC_R_SUCCESS;)
|
||||
{
|
||||
dns_catz_zone_t *zone = NULL;
|
||||
isc_ht_iter_current(iter, (void **)&zone);
|
||||
result = isc_ht_iter_delcurrent_next(iter);
|
||||
|
|
@ -1045,7 +1053,8 @@ catz_opt_cmp(const dns_label_t *option, const char *opt) {
|
|||
size_t len = strlen(opt);
|
||||
|
||||
if (option->length - 1 == len &&
|
||||
memcmp(opt, option->base + 1, len) == 0) {
|
||||
memcmp(opt, option->base + 1, len) == 0)
|
||||
{
|
||||
return (true);
|
||||
} else {
|
||||
return (false);
|
||||
|
|
@ -1059,7 +1068,8 @@ catz_get_option(const dns_label_t *option) {
|
|||
} else if (catz_opt_cmp(option, "zones")) {
|
||||
return (CATZ_OPT_ZONES);
|
||||
} else if (catz_opt_cmp(option, "masters") ||
|
||||
catz_opt_cmp(option, "primaries")) {
|
||||
catz_opt_cmp(option, "primaries"))
|
||||
{
|
||||
return (CATZ_OPT_PRIMARIES);
|
||||
} else if (catz_opt_cmp(option, "allow-query")) {
|
||||
return (CATZ_OPT_ALLOW_QUERY);
|
||||
|
|
@ -1426,7 +1436,8 @@ catz_process_primaries(dns_catz_zone_t *zone, dns_ipkeylist_t *ipkl,
|
|||
*/
|
||||
for (i = 0; i < ipkl->count; i++) {
|
||||
if (ipkl->labels[i] != NULL &&
|
||||
!dns_name_compare(name, ipkl->labels[i])) {
|
||||
!dns_name_compare(name, ipkl->labels[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -804,7 +804,8 @@ client_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
|
|||
tresult = dns_rdatasetiter_next(rdsiter);
|
||||
|
||||
if (tresult == ISC_R_SUCCESS &&
|
||||
rctx->rdataset == NULL) {
|
||||
rctx->rdataset == NULL)
|
||||
{
|
||||
tresult = getrdataset(mctx,
|
||||
&rctx->rdataset);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
|
|
@ -863,7 +864,8 @@ client_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
|
|||
dns_rdataset_t *rdataset;
|
||||
|
||||
while ((rdataset = ISC_LIST_HEAD(ansname->list)) !=
|
||||
NULL) {
|
||||
NULL)
|
||||
{
|
||||
ISC_LIST_UNLINK(ansname->list, rdataset, link);
|
||||
putrdataset(mctx, &rdataset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,7 +260,8 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
|
|||
i = tableindex[ch];
|
||||
if ((cctx->allowed & DNS_COMPRESS_CASESENSITIVE) != 0) {
|
||||
for (node = cctx->table[i]; node != NULL;
|
||||
node = node->next) {
|
||||
node = node->next)
|
||||
{
|
||||
if (node->name.length != length) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -271,7 +272,8 @@ dns_compress_findglobal(dns_compress_t *cctx, const dns_name_t *name,
|
|||
}
|
||||
} else {
|
||||
for (node = cctx->table[i]; node != NULL;
|
||||
node = node->next) {
|
||||
node = node->next)
|
||||
{
|
||||
unsigned int l, count;
|
||||
unsigned char c;
|
||||
unsigned char *label1, *label2;
|
||||
|
|
|
|||
|
|
@ -1028,7 +1028,8 @@ dns_db_updatenotify_unregister(dns_db_t *db, dns_dbupdate_callback_t fn,
|
|||
listener = ISC_LIST_NEXT(listener, link))
|
||||
{
|
||||
if ((listener->onupdate == fn) &&
|
||||
(listener->onupdate_arg == fn_arg)) {
|
||||
(listener->onupdate_arg == fn_arg))
|
||||
{
|
||||
ISC_LIST_UNLINK(db->update_listeners, listener, link);
|
||||
isc_mem_put(db->mctx, listener,
|
||||
sizeof(dns_dbonupdatelistener_t));
|
||||
|
|
|
|||
|
|
@ -303,7 +303,8 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
|
|||
|
||||
node = NULL;
|
||||
if (type != dns_rdatatype_nsec3 &&
|
||||
covers != dns_rdatatype_nsec3) {
|
||||
covers != dns_rdatatype_nsec3)
|
||||
{
|
||||
CHECK(dns_db_findnode(db, name, true, &node));
|
||||
} else {
|
||||
CHECK(dns_db_findnsec3node(db, name, true,
|
||||
|
|
@ -385,11 +386,13 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
|
|||
resign);
|
||||
}
|
||||
if (op == DNS_DIFFOP_ADD ||
|
||||
op == DNS_DIFFOP_ADDRESIGN) {
|
||||
op == DNS_DIFFOP_ADDRESIGN)
|
||||
{
|
||||
setownercase(&ardataset, name);
|
||||
}
|
||||
if (op == DNS_DIFFOP_DEL ||
|
||||
op == DNS_DIFFOP_DELRESIGN) {
|
||||
op == DNS_DIFFOP_DELRESIGN)
|
||||
{
|
||||
getownercase(&ardataset, name);
|
||||
}
|
||||
} else if (result == DNS_R_UNCHANGED) {
|
||||
|
|
@ -415,11 +418,13 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
|
|||
namebuf, classbuf);
|
||||
}
|
||||
if (op == DNS_DIFFOP_ADD ||
|
||||
op == DNS_DIFFOP_ADDRESIGN) {
|
||||
op == DNS_DIFFOP_ADDRESIGN)
|
||||
{
|
||||
setownercase(&ardataset, name);
|
||||
}
|
||||
if (op == DNS_DIFFOP_DEL ||
|
||||
op == DNS_DIFFOP_DELRESIGN) {
|
||||
op == DNS_DIFFOP_DELRESIGN)
|
||||
{
|
||||
getownercase(&ardataset, name);
|
||||
}
|
||||
} else if (result == DNS_R_NXRRSET) {
|
||||
|
|
@ -427,7 +432,8 @@ diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver, bool warn) {
|
|||
* OK.
|
||||
*/
|
||||
if (op == DNS_DIFFOP_DEL ||
|
||||
op == DNS_DIFFOP_DELRESIGN) {
|
||||
op == DNS_DIFFOP_DELRESIGN)
|
||||
{
|
||||
getownercase(&ardataset, name);
|
||||
}
|
||||
if (dns_rdataset_isassociated(&ardataset)) {
|
||||
|
|
@ -519,7 +525,8 @@ dns_diff_load(dns_diff_t *diff, dns_addrdatasetfunc_t addfunc,
|
|||
"dns_diff_load: "
|
||||
"update with no effect");
|
||||
} else if (result == ISC_R_SUCCESS ||
|
||||
result == DNS_R_NXRRSET) {
|
||||
result == DNS_R_NXRRSET)
|
||||
{
|
||||
/*
|
||||
* OK.
|
||||
*/
|
||||
|
|
@ -546,7 +553,8 @@ dns_diff_sort(dns_diff_t *diff, dns_diff_compare_func *compare) {
|
|||
REQUIRE(DNS_DIFF_VALID(diff));
|
||||
|
||||
for (p = ISC_LIST_HEAD(diff->tuples); p != NULL;
|
||||
p = ISC_LIST_NEXT(p, link)) {
|
||||
p = ISC_LIST_NEXT(p, link))
|
||||
{
|
||||
length++;
|
||||
}
|
||||
if (length == 0) {
|
||||
|
|
@ -604,7 +612,8 @@ dns_diff_print(dns_diff_t *diff, FILE *file) {
|
|||
mem = isc_mem_get(diff->mctx, size);
|
||||
|
||||
for (t = ISC_LIST_HEAD(diff->tuples); t != NULL;
|
||||
t = ISC_LIST_NEXT(t, link)) {
|
||||
t = ISC_LIST_NEXT(t, link))
|
||||
{
|
||||
isc_buffer_t buf;
|
||||
isc_region_t r;
|
||||
|
||||
|
|
|
|||
|
|
@ -371,7 +371,8 @@ entry_search(dns_qid_t *qid, const isc_sockaddr_t *dest, dns_messageid_t id,
|
|||
|
||||
while (res != NULL) {
|
||||
if (res->id == id && isc_sockaddr_equal(dest, &res->peer) &&
|
||||
res->port == port) {
|
||||
res->port == port)
|
||||
{
|
||||
return (res);
|
||||
}
|
||||
res = ISC_LIST_NEXT(res, link);
|
||||
|
|
@ -1212,7 +1213,8 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr,
|
|||
isc_sockaddr_eqaddr(localaddr, &sockname)))
|
||||
{
|
||||
if (atomic_load(&disp->tcpstate) ==
|
||||
DNS_DISPATCHSTATE_CONNECTED) {
|
||||
DNS_DISPATCHSTATE_CONNECTED)
|
||||
{
|
||||
/* We found connected dispatch */
|
||||
disp_connected = disp;
|
||||
UNLOCK(&disp->lock);
|
||||
|
|
@ -1533,7 +1535,8 @@ dispatch_getnext(dns_dispatch_t *disp, dns_dispentry_t *resp, int32_t timeout) {
|
|||
|
||||
case isc_socktype_tcp:
|
||||
if (atomic_compare_exchange_strong(&disp->tcpreading,
|
||||
&(bool){ false }, true)) {
|
||||
&(bool){ false }, true))
|
||||
{
|
||||
dns_dispatch_attach(disp, &(dns_dispatch_t *){ NULL });
|
||||
if (timeout > 0) {
|
||||
isc_nmhandle_settimeout(disp->handle, timeout);
|
||||
|
|
|
|||
|
|
@ -473,7 +473,8 @@ rpsdb_bind_soa(dns_rdataset_t *rdataset, rpsdb_t *rpsdb) {
|
|||
librpz_emsg_t emsg;
|
||||
|
||||
if (!librpz->rsp_soa(&emsg, &ttl, NULL, NULL, &rpsdb->result,
|
||||
rpsdb->rsp)) {
|
||||
rpsdb->rsp))
|
||||
{
|
||||
librpz->log(LIBRPZ_LOG_ERROR, NULL, "%s", emsg.c);
|
||||
return (DNS_R_SERVFAIL);
|
||||
}
|
||||
|
|
@ -707,7 +708,8 @@ rpsdb_rdataset_next(dns_rdataset_t *rdataset) {
|
|||
}
|
||||
RD_NEXT_RR(rdataset) = LIBRPZ_IDX_NULL;
|
||||
if (!librpz->rsp_soa(&emsg, NULL, &rr, NULL, &rpsdb->result,
|
||||
rpsdb->rsp)) {
|
||||
rpsdb->rsp))
|
||||
{
|
||||
librpz->log(LIBRPZ_LOG_ERROR, NULL, "%s", emsg.c);
|
||||
return (DNS_R_SERVFAIL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -788,7 +788,8 @@ dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node,
|
|||
dst_key_setttl(pubkey, rdataset.ttl);
|
||||
|
||||
if (!is_zone_key(pubkey) ||
|
||||
(dst_key_flags(pubkey) & DNS_KEYTYPE_NOAUTH) != 0) {
|
||||
(dst_key_flags(pubkey) & DNS_KEYTYPE_NOAUTH) != 0)
|
||||
{
|
||||
goto next;
|
||||
}
|
||||
/* Corrupted .key file? */
|
||||
|
|
@ -821,7 +822,8 @@ dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node,
|
|||
directory, mctx, &keys[count]);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
dst_key_pubcompare(pubkey, keys[count],
|
||||
false)) {
|
||||
false))
|
||||
{
|
||||
dst_key_setflags(keys[count], flags);
|
||||
}
|
||||
dst_key_setflags(pubkey, flags);
|
||||
|
|
@ -1452,7 +1454,8 @@ dns_dnssec_findmatchingkeys(const dns_name_t *origin, const char *directory,
|
|||
* Did we correctly terminate?
|
||||
*/
|
||||
if (i != len + 1 + 1 + 3 || i >= dir.entry.length ||
|
||||
dir.entry.name[i] != '+') {
|
||||
dir.entry.name[i] != '+')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1552,7 +1555,8 @@ addkey(dns_dnsseckeylist_t *keylist, dst_key_t **newkey, bool savekeys,
|
|||
|
||||
/* Skip duplicates */
|
||||
for (key = ISC_LIST_HEAD(*keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
if (dst_key_id(key->key) == dst_key_id(*newkey) &&
|
||||
dst_key_alg(key->key) == dst_key_alg(*newkey) &&
|
||||
dns_name_equal(dst_key_name(key->key),
|
||||
|
|
@ -1610,7 +1614,8 @@ mark_active_keys(dns_dnsseckeylist_t *keylist, dns_rdataset_t *rrsigs) {
|
|||
dns_rdataset_init(&sigs);
|
||||
dns_rdataset_clone(rrsigs, &sigs);
|
||||
for (key = ISC_LIST_HEAD(*keylist); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
uint16_t keyid, sigid;
|
||||
dns_secalg_t keyalg, sigalg;
|
||||
keyid = dst_key_id(key->key);
|
||||
|
|
@ -1682,7 +1687,8 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin, const char *directory,
|
|||
dst_key_setttl(dnskey, keys.ttl);
|
||||
|
||||
if (!is_zone_key(dnskey) ||
|
||||
(dst_key_flags(dnskey) & DNS_KEYTYPE_NOAUTH) != 0) {
|
||||
(dst_key_flags(dnskey) & DNS_KEYTYPE_NOAUTH) != 0)
|
||||
{
|
||||
goto skip;
|
||||
}
|
||||
|
||||
|
|
@ -1974,7 +1980,8 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
|
|||
dns_dnsseckey_t *key;
|
||||
|
||||
for (key = ISC_LIST_HEAD(*keys); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
dns_rdata_t cds_sha1 = DNS_RDATA_INIT;
|
||||
dns_rdata_t cds_sha256 = DNS_RDATA_INIT;
|
||||
dns_rdata_t cdnskeyrdata = DNS_RDATA_INIT;
|
||||
|
|
@ -2010,7 +2017,8 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
|
|||
dst_key_format(key->key, keystr, sizeof(keystr));
|
||||
|
||||
if (!dns_rdataset_isassociated(cdnskey) ||
|
||||
!exists(cdnskey, &cdnskeyrdata)) {
|
||||
!exists(cdnskey, &cdnskeyrdata))
|
||||
{
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_DNSSEC,
|
||||
ISC_LOG_INFO,
|
||||
|
|
@ -2021,7 +2029,8 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
|
|||
}
|
||||
/* Only publish SHA-256 (SHA-1 is deprecated) */
|
||||
if (!dns_rdataset_isassociated(cds) ||
|
||||
!exists(cds, &cds_sha256)) {
|
||||
!exists(cds, &cds_sha256))
|
||||
{
|
||||
isc_log_write(
|
||||
dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
|
||||
|
|
@ -2081,7 +2090,8 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
|
|||
}
|
||||
|
||||
if (!dns_rdataset_isassociated(cds) &&
|
||||
!dns_rdataset_isassociated(cdnskey)) {
|
||||
!dns_rdataset_isassociated(cdnskey))
|
||||
{
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -2089,7 +2099,8 @@ dns_dnssec_syncupdate(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *rmkeys,
|
|||
* Unconditionally remove CDS/DNSKEY records for removed keys.
|
||||
*/
|
||||
for (key = ISC_LIST_HEAD(*rmkeys); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
dns_rdata_t cds_sha1 = DNS_RDATA_INIT;
|
||||
dns_rdata_t cds_sha256 = DNS_RDATA_INIT;
|
||||
dns_rdata_t cdnskeyrdata = DNS_RDATA_INIT;
|
||||
|
|
@ -2174,7 +2185,8 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
|
|||
|
||||
if (expect_cds_delete) {
|
||||
if (!dns_rdataset_isassociated(cds) ||
|
||||
!exists(cds, &cds_delete)) {
|
||||
!exists(cds, &cds_delete))
|
||||
{
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
|
||||
"CDS (DELETE) for zone %s is now "
|
||||
|
|
@ -2197,7 +2209,8 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
|
|||
|
||||
if (expect_cdnskey_delete) {
|
||||
if (!dns_rdataset_isassociated(cdnskey) ||
|
||||
!exists(cdnskey, &cdnskey_delete)) {
|
||||
!exists(cdnskey, &cdnskey_delete))
|
||||
{
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
|
||||
"CDNSKEY (DELETE) for zone %s is now "
|
||||
|
|
@ -2208,7 +2221,8 @@ dns_dnssec_syncdelete(dns_rdataset_t *cds, dns_rdataset_t *cdnskey,
|
|||
}
|
||||
} else {
|
||||
if (dns_rdataset_isassociated(cdnskey) &&
|
||||
exists(cdnskey, &cdnskey_delete)) {
|
||||
exists(cdnskey, &cdnskey_delete))
|
||||
{
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
|
||||
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
|
||||
"CDNSKEY (DELETE) for zone %s is now "
|
||||
|
|
@ -2250,7 +2264,8 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
|
|||
* use their TTL for all subsequent published keys.
|
||||
*/
|
||||
for (key = ISC_LIST_HEAD(*keys); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
if (key->source == dns_keysource_user &&
|
||||
(key->hint_publish || key->force_publish))
|
||||
{
|
||||
|
|
@ -2271,10 +2286,12 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
|
|||
dns_ttl_t shortest = 0;
|
||||
|
||||
for (key = ISC_LIST_HEAD(*newkeys); key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
key = ISC_LIST_NEXT(key, link))
|
||||
{
|
||||
dns_ttl_t thisttl = dst_key_getttl(key->key);
|
||||
if (thisttl != 0 &&
|
||||
(shortest == 0 || thisttl < shortest)) {
|
||||
(shortest == 0 || thisttl < shortest))
|
||||
{
|
||||
shortest = thisttl;
|
||||
}
|
||||
}
|
||||
|
|
@ -2422,7 +2439,8 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
|
|||
continue;
|
||||
} else {
|
||||
if (!key2->is_active &&
|
||||
(key1->hint_sign || key1->force_sign)) {
|
||||
(key1->hint_sign || key1->force_sign))
|
||||
{
|
||||
key2->first_sign = true;
|
||||
isc_log_write(
|
||||
dns_lctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
|
|
@ -2431,7 +2449,8 @@ dns_dnssec_updatekeys(dns_dnsseckeylist_t *keys, dns_dnsseckeylist_t *newkeys,
|
|||
key1->ksk ? (key1->zsk ? "CSK" : "KSK")
|
||||
: "ZSK");
|
||||
} else if (key2->is_active && !key1->hint_sign &&
|
||||
!key1->force_sign) {
|
||||
!key1->force_sign)
|
||||
{
|
||||
isc_log_write(
|
||||
dns_lctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
|
||||
|
|
|
|||
|
|
@ -1227,7 +1227,8 @@ comparekeys(const dst_key_t *key1, const dst_key_t *key2,
|
|||
return (false);
|
||||
}
|
||||
if (key1->key_id != key2->key_rid &&
|
||||
key1->key_rid != key2->key_id) {
|
||||
key1->key_rid != key2->key_id)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
|
@ -2251,7 +2252,8 @@ buildfilename(dns_name_t *name, dns_keytag_t id, unsigned int alg,
|
|||
}
|
||||
isc_buffer_putstr(out, directory);
|
||||
if (strlen(directory) > 0U &&
|
||||
directory[strlen(directory) - 1] != '/') {
|
||||
directory[strlen(directory) - 1] != '/')
|
||||
{
|
||||
isc_buffer_putstr(out, "/");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ find_value(const char *s, const unsigned int alg) {
|
|||
|
||||
for (i = 0; map[i].tag != NULL; i++) {
|
||||
if (strcasecmp(s, map[i].tag) == 0 &&
|
||||
(TAG_ALG(map[i].value) == alg)) {
|
||||
(TAG_ALG(map[i].value) == alg))
|
||||
{
|
||||
return (map[i].value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ dns_ecs_equals(const dns_ecs_t *ecs1, const dns_ecs_t *ecs2) {
|
|||
REQUIRE(ecs1 != NULL && ecs2 != NULL);
|
||||
|
||||
if (ecs1->source != ecs2->source ||
|
||||
ecs1->addr.family != ecs2->addr.family) {
|
||||
ecs1->addr.family != ecs2->addr.family)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ dns_fwdtable_addfwd(dns_fwdtable_t *fwdtable, const dns_name_t *name,
|
|||
|
||||
ISC_LIST_INIT(forwarders->fwdrs);
|
||||
for (fwd = ISC_LIST_HEAD(*fwdrs); fwd != NULL;
|
||||
fwd = ISC_LIST_NEXT(fwd, link)) {
|
||||
fwd = ISC_LIST_NEXT(fwd, link))
|
||||
{
|
||||
nfwd = isc_mem_get(fwdtable->mctx, sizeof(dns_forwarder_t));
|
||||
*nfwd = *fwd;
|
||||
ISC_LINK_INIT(nfwd, link);
|
||||
|
|
@ -122,7 +123,8 @@ dns_fwdtable_add(dns_fwdtable_t *fwdtable, const dns_name_t *name,
|
|||
|
||||
ISC_LIST_INIT(forwarders->fwdrs);
|
||||
for (sa = ISC_LIST_HEAD(*addrs); sa != NULL;
|
||||
sa = ISC_LIST_NEXT(sa, link)) {
|
||||
sa = ISC_LIST_NEXT(sa, link))
|
||||
{
|
||||
fwd = isc_mem_get(fwdtable->mctx, sizeof(dns_forwarder_t));
|
||||
fwd->addr = *sa;
|
||||
fwd->dscp = -1;
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static struct cc {
|
|||
struct cc *next;
|
||||
int rdclass;
|
||||
char classbuf[TYPECLASSBUF];
|
||||
} * classes;
|
||||
} *classes;
|
||||
|
||||
static struct tt {
|
||||
struct tt *next;
|
||||
|
|
@ -146,7 +146,7 @@ static struct tt {
|
|||
char classbuf[TYPECLASSBUF];
|
||||
char typebuf[TYPECLASSBUF];
|
||||
char dirbuf[PATH_MAX - 30];
|
||||
} * types;
|
||||
} *types;
|
||||
|
||||
static struct ttnam {
|
||||
char typebuf[TYPECLASSBUF];
|
||||
|
|
|
|||
|
|
@ -338,7 +338,8 @@ hmac_fromdns(const isc_md_type_t *type, dst_key_t *key, isc_buffer_t *data) {
|
|||
/* Hash the key if the key is longer then chosen MD block size */
|
||||
if (r.length > (unsigned int)isc_md_type_get_block_size(type)) {
|
||||
if (isc_md(type, r.base, r.length, hkey->key, &keylen) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
isc_mem_put(key->mctx, hkey, sizeof(dst_hmac_key_t));
|
||||
return (DST_R_OPENSSLFAILURE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -866,7 +866,8 @@ maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
|
|||
* transaction headers in a version 1 journal.
|
||||
*/
|
||||
if ((xhdr->serial0 != serial ||
|
||||
isc_serial_le(xhdr->serial1, xhdr->serial0))) {
|
||||
isc_serial_le(xhdr->serial1, xhdr->serial0)))
|
||||
{
|
||||
if (j->xhdr_version == XHDR_VERSION1 && xhdr->serial1 == serial)
|
||||
{
|
||||
isc_log_write(
|
||||
|
|
@ -878,7 +879,8 @@ maybe_fixup_xhdr(dns_journal_t *j, journal_xhdr_t *xhdr, uint32_t serial,
|
|||
CHECK(journal_read_xhdr(j, xhdr));
|
||||
j->recovered = true;
|
||||
} else if (j->xhdr_version == XHDR_VERSION2 &&
|
||||
xhdr->count == serial) {
|
||||
xhdr->count == serial)
|
||||
{
|
||||
isc_log_write(
|
||||
JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3),
|
||||
"%s: XHDR_VERSION2 -> XHDR_VERSION1 at %u",
|
||||
|
|
@ -973,7 +975,8 @@ journal_next(dns_journal_t *j, journal_pos_t *pos) {
|
|||
* Check serial number consistency.
|
||||
*/
|
||||
if (xhdr.serial0 != pos->serial ||
|
||||
isc_serial_le(xhdr.serial1, xhdr.serial0)) {
|
||||
isc_serial_le(xhdr.serial1, xhdr.serial0))
|
||||
{
|
||||
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR,
|
||||
"%s: journal file corrupt: "
|
||||
"expected serial %u, got %u",
|
||||
|
|
@ -1203,7 +1206,8 @@ dns_journal_writediff(dns_journal_t *j, dns_diff_t *diff) {
|
|||
* keep track of SOA serial numbers.
|
||||
*/
|
||||
for (t = ISC_LIST_HEAD(diff->tuples); t != NULL;
|
||||
t = ISC_LIST_NEXT(t, link)) {
|
||||
t = ISC_LIST_NEXT(t, link))
|
||||
{
|
||||
if (t->rdata.type == dns_rdatatype_soa) {
|
||||
if (j->x.n_soa < 2) {
|
||||
j->x.pos[j->x.n_soa].serial =
|
||||
|
|
@ -1233,7 +1237,8 @@ dns_journal_writediff(dns_journal_t *j, dns_diff_t *diff) {
|
|||
* Pass 2. Write RRs to buffer.
|
||||
*/
|
||||
for (t = ISC_LIST_HEAD(diff->tuples); t != NULL;
|
||||
t = ISC_LIST_NEXT(t, link)) {
|
||||
t = ISC_LIST_NEXT(t, link))
|
||||
{
|
||||
/*
|
||||
* Write the RR header.
|
||||
*/
|
||||
|
|
@ -1345,7 +1350,8 @@ dns_journal_commit(dns_journal_t *j) {
|
|||
*/
|
||||
if (!JOURNAL_EMPTY(&j->header)) {
|
||||
while (!DNS_SERIAL_GT(j->x.pos[1].serial,
|
||||
j->header.begin.serial)) {
|
||||
j->header.begin.serial))
|
||||
{
|
||||
CHECK(journal_next(j, &j->header.begin));
|
||||
}
|
||||
index_invalidate(j, j->x.pos[1].serial);
|
||||
|
|
@ -1890,7 +1896,8 @@ dns_journal_iter_init(dns_journal_t *j, uint32_t begin_serial,
|
|||
* Check that xhdr is consistent.
|
||||
*/
|
||||
if (xhdr.serial0 != pos.serial ||
|
||||
isc_serial_le(xhdr.serial1, xhdr.serial0)) {
|
||||
isc_serial_le(xhdr.serial1, xhdr.serial0))
|
||||
{
|
||||
CHECK(ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
|
|
@ -2642,7 +2649,8 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
|
|||
* xhdr format may be wrong.
|
||||
*/
|
||||
if (rewrite && (result != ISC_R_SUCCESS ||
|
||||
!check_delta(buf, size))) {
|
||||
!check_delta(buf, size)))
|
||||
{
|
||||
if (j1->xhdr_version == XHDR_VERSION2) {
|
||||
/* XHDR_VERSION2 -> XHDR_VERSION1 */
|
||||
j1->xhdr_version = XHDR_VERSION1;
|
||||
|
|
@ -2696,7 +2704,8 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
|
|||
* Check that xhdr is consistent.
|
||||
*/
|
||||
if (xhdr.serial0 != serial ||
|
||||
isc_serial_le(xhdr.serial1, xhdr.serial0)) {
|
||||
isc_serial_le(xhdr.serial1, xhdr.serial0))
|
||||
{
|
||||
CHECK(ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
|
|
@ -2785,7 +2794,8 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
|
|||
if (errno == EEXIST && !is_backup) {
|
||||
result = isc_file_remove(backup);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != ISC_R_FILENOTFOUND) {
|
||||
result != ISC_R_FILENOTFOUND)
|
||||
{
|
||||
goto failure;
|
||||
}
|
||||
if (rename(filename, backup) == -1) {
|
||||
|
|
|
|||
|
|
@ -134,7 +134,8 @@ dst_key_iszonekey(const dst_key_t *key) {
|
|||
return (false);
|
||||
}
|
||||
if (key->key_proto != DNS_KEYPROTO_DNSSEC &&
|
||||
key->key_proto != DNS_KEYPROTO_ANY) {
|
||||
key->key_proto != DNS_KEYPROTO_ANY)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
return (true);
|
||||
|
|
@ -151,7 +152,8 @@ dst_key_isnullkey(const dst_key_t *key) {
|
|||
return (false);
|
||||
}
|
||||
if (key->key_proto != DNS_KEYPROTO_DNSSEC &&
|
||||
key->key_proto != DNS_KEYPROTO_ANY) {
|
||||
key->key_proto != DNS_KEYPROTO_ANY)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
return (true);
|
||||
|
|
|
|||
|
|
@ -329,7 +329,8 @@ keymgr_key_retire(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now) {
|
|||
ret = dst_key_getbool(key->key, DST_BOOL_KSK, &ksk);
|
||||
if (ret == ISC_R_SUCCESS && ksk) {
|
||||
if (dst_key_getstate(key->key, DST_KEY_KRRSIG, &s) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
dst_key_setstate(key->key, DST_KEY_KRRSIG, OMNIPRESENT);
|
||||
dst_key_settime(key->key, DST_TIME_KRRSIG, now);
|
||||
}
|
||||
|
|
@ -342,7 +343,8 @@ keymgr_key_retire(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now) {
|
|||
ret = dst_key_getbool(key->key, DST_BOOL_ZSK, &zsk);
|
||||
if (ret == ISC_R_SUCCESS && zsk) {
|
||||
if (dst_key_getstate(key->key, DST_KEY_ZRRSIG, &s) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
dst_key_setstate(key->key, DST_KEY_ZRRSIG, OMNIPRESENT);
|
||||
dst_key_settime(key->key, DST_TIME_ZRRSIG, now);
|
||||
}
|
||||
|
|
@ -550,7 +552,8 @@ keymgr_key_match_state(dst_key_t *key, dst_key_t *subject, int type,
|
|||
continue;
|
||||
}
|
||||
if (next_state != NA && i == type &&
|
||||
dst_key_id(key) == dst_key_id(subject)) {
|
||||
dst_key_id(key) == dst_key_id(subject))
|
||||
{
|
||||
/* Check next state rather than current state. */
|
||||
state = next_state;
|
||||
} else if (dst_key_getstate(key, i, &state) != ISC_R_SUCCESS) {
|
||||
|
|
@ -708,12 +711,14 @@ keymgr_key_exists_with_state(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
|||
dkey = ISC_LIST_NEXT(dkey, link))
|
||||
{
|
||||
if (match_algorithms &&
|
||||
(dst_key_alg(dkey->key) != dst_key_alg(key->key))) {
|
||||
(dst_key_alg(dkey->key) != dst_key_alg(key->key)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!keymgr_key_match_state(dkey->key, key->key, type,
|
||||
next_state, states)) {
|
||||
next_state, states))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -734,7 +739,8 @@ keymgr_key_exists_with_state(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
|||
}
|
||||
|
||||
if (!keymgr_key_match_state(skey->key, key->key, type,
|
||||
next_state, states2)) {
|
||||
next_state, states2))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -793,12 +799,14 @@ keymgr_ds_hidden_or_chained(dns_dnsseckeylist_t *keyring, dns_dnsseckey_t *key,
|
|||
dkey = ISC_LIST_NEXT(dkey, link))
|
||||
{
|
||||
if (match_algorithms &&
|
||||
(dst_key_alg(dkey->key) != dst_key_alg(key->key))) {
|
||||
(dst_key_alg(dkey->key) != dst_key_alg(key->key)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keymgr_key_match_state(dkey->key, key->key, type,
|
||||
next_state, ds_hidden)) {
|
||||
next_state, ds_hidden))
|
||||
{
|
||||
/* This key has its DS hidden. */
|
||||
continue;
|
||||
}
|
||||
|
|
@ -860,7 +868,8 @@ keymgr_dnskey_hidden_or_chained(dns_dnsseckeylist_t *keyring,
|
|||
dkey = ISC_LIST_NEXT(dkey, link))
|
||||
{
|
||||
if (match_algorithms &&
|
||||
(dst_key_alg(dkey->key) != dst_key_alg(key->key))) {
|
||||
(dst_key_alg(dkey->key) != dst_key_alg(key->key)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1445,7 +1454,8 @@ transition:
|
|||
|
||||
/* Is the transition allowed according to policy? */
|
||||
if (!keymgr_policy_approval(keyring, dkey, i,
|
||||
next_state)) {
|
||||
next_state))
|
||||
{
|
||||
/* No, please respect rollover methods. */
|
||||
isc_log_write(
|
||||
dns_lctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
|
|
@ -1619,7 +1629,8 @@ keymgr_key_init(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now,
|
|||
|
||||
/* Set goal if not already set. */
|
||||
if (dst_key_getstate(key->key, DST_KEY_GOAL, &goal_state) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
dst_key_setstate(key->key, DST_KEY_GOAL, goal_state);
|
||||
}
|
||||
|
||||
|
|
@ -2040,7 +2051,8 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
|
|||
|
||||
/* Check purge-keys interval. */
|
||||
if (keymgr_key_may_be_purged(dkey->key,
|
||||
dns_kasp_purgekeys(kasp), now)) {
|
||||
dns_kasp_purgekeys(kasp), now))
|
||||
{
|
||||
dst_key_format(dkey->key, keystr, sizeof(keystr));
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DNSSEC,
|
||||
DNS_LOGMODULE_DNSSEC, ISC_LOG_INFO,
|
||||
|
|
@ -2087,7 +2099,8 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
|
|||
/* Initialize lifetime if not set. */
|
||||
uint32_t l;
|
||||
if (dst_key_getnum(dkey->key, DST_NUM_LIFETIME,
|
||||
&l) != ISC_R_SUCCESS) {
|
||||
&l) != ISC_R_SUCCESS)
|
||||
{
|
||||
dst_key_setnum(dkey->key,
|
||||
DST_NUM_LIFETIME,
|
||||
lifetime);
|
||||
|
|
@ -2121,7 +2134,8 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
|
|||
* or desires to be active.
|
||||
*/
|
||||
if (dst_key_goal(dkey->key) == OMNIPRESENT ||
|
||||
dst_key_is_active(dkey->key, now)) {
|
||||
dst_key_is_active(dkey->key, now))
|
||||
{
|
||||
active_key = dkey;
|
||||
}
|
||||
}
|
||||
|
|
@ -2139,7 +2153,8 @@ dns_keymgr_run(const dns_name_t *origin, dns_rdataclass_t rdclass,
|
|||
dnskey = ISC_LIST_NEXT(dnskey, link))
|
||||
{
|
||||
if (keymgr_dnsseckey_kaspkey_match(dnskey,
|
||||
kkey)) {
|
||||
kkey))
|
||||
{
|
||||
/* Found a match. */
|
||||
dst_key_format(dnskey->key, keystr,
|
||||
sizeof(keystr));
|
||||
|
|
|
|||
|
|
@ -367,7 +367,8 @@ gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *token, bool eol,
|
|||
}
|
||||
if (eol != true) {
|
||||
if (token->type == isc_tokentype_eol ||
|
||||
token->type == isc_tokentype_eof) {
|
||||
token->type == isc_tokentype_eof)
|
||||
{
|
||||
{
|
||||
unsigned long int line;
|
||||
const char *what;
|
||||
|
|
@ -883,7 +884,8 @@ generate(dns_loadctx_t *lctx, char *range, char *lhs, char *gtype, char *rhs,
|
|||
}
|
||||
|
||||
if (dns_master_isprimary(lctx) &&
|
||||
!dns_name_issubdomain(owner, lctx->top)) {
|
||||
!dns_name_issubdomain(owner, lctx->top))
|
||||
{
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
dns_name_format(owner, namebuf, sizeof(namebuf));
|
||||
/*
|
||||
|
|
@ -1199,7 +1201,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
EXPECTEOL;
|
||||
continue;
|
||||
} else if (strcasecmp(DNS_AS_STR(token), "$INCLUDE") ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
COMMITALL;
|
||||
if ((lctx->options & DNS_MASTER_NOINCLUDE) != 0)
|
||||
{
|
||||
|
|
@ -1233,7 +1236,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
GETTOKEN(lctx->lex, 0, &token, true);
|
||||
|
||||
if (token.type == isc_tokentype_eol ||
|
||||
token.type == isc_tokentype_eof) {
|
||||
token.type == isc_tokentype_eof)
|
||||
{
|
||||
if (token.type == isc_tokentype_eof) {
|
||||
WARNUNEXPECTEDEOF(lctx->lex);
|
||||
}
|
||||
|
|
@ -1299,7 +1303,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
EXPECTEOL;
|
||||
continue;
|
||||
} else if (strcasecmp(DNS_AS_STR(token), "$GENERATE") ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
/*
|
||||
* Lazy cleanup.
|
||||
*/
|
||||
|
|
@ -1336,7 +1341,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
/* TTL? */
|
||||
if (dns_ttl_fromtext(&token.value.as_textregion,
|
||||
&lctx->ttl) ==
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
limit_ttl(callbacks, source, line,
|
||||
&lctx->ttl);
|
||||
lctx->ttl_known = true;
|
||||
|
|
@ -1359,7 +1365,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
false);
|
||||
rhs = isc_mem_strdup(mctx, DNS_AS_STR(token));
|
||||
if (!lctx->ttl_known &&
|
||||
!lctx->default_ttl_known) {
|
||||
!lctx->default_ttl_known)
|
||||
{
|
||||
(*callbacks->error)(callbacks,
|
||||
"%s: %s:%lu: no "
|
||||
"TTL specified",
|
||||
|
|
@ -1373,7 +1380,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
goto insist_and_cleanup;
|
||||
}
|
||||
} else if (!explicit_ttl &&
|
||||
lctx->default_ttl_known) {
|
||||
lctx->default_ttl_known)
|
||||
{
|
||||
lctx->ttl = lctx->default_ttl;
|
||||
}
|
||||
/*
|
||||
|
|
@ -1477,7 +1485,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
* state. Linked lists are undone by commit().
|
||||
*/
|
||||
if (ictx->glue != NULL &&
|
||||
!dns_name_caseequal(ictx->glue, new_name)) {
|
||||
!dns_name_caseequal(ictx->glue, new_name))
|
||||
{
|
||||
result = commit(callbacks, lctx, &glue_list,
|
||||
ictx->glue, source,
|
||||
ictx->glue_line);
|
||||
|
|
@ -1508,7 +1517,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
!dns_name_caseequal(ictx->current, new_name)))
|
||||
{
|
||||
if (current_has_delegation &&
|
||||
is_glue(¤t_list, new_name)) {
|
||||
is_glue(¤t_list, new_name))
|
||||
{
|
||||
rdcount_save = rdcount;
|
||||
rdlcount_save = rdlcount;
|
||||
target_save = target;
|
||||
|
|
@ -1544,13 +1554,15 @@ load_text(dns_loadctx_t *lctx) {
|
|||
* Check for internal wildcards.
|
||||
*/
|
||||
if ((lctx->options &
|
||||
DNS_MASTER_CHECKWILDCARD) != 0) {
|
||||
DNS_MASTER_CHECKWILDCARD) != 0)
|
||||
{
|
||||
check_wildcard(ictx, source, line,
|
||||
callbacks);
|
||||
}
|
||||
}
|
||||
if (dns_master_isprimary(lctx) &&
|
||||
!dns_name_issubdomain(new_name, lctx->top)) {
|
||||
!dns_name_issubdomain(new_name, lctx->top))
|
||||
{
|
||||
char namebuf[DNS_NAME_FORMATSIZE];
|
||||
dns_name_format(new_name, namebuf,
|
||||
sizeof(namebuf));
|
||||
|
|
@ -1833,7 +1845,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
result = DNS_R_BADOWNERNAME;
|
||||
desc = isc_result_totext(result);
|
||||
if (CHECKNAMESFAIL(lctx->options) ||
|
||||
type == dns_rdatatype_nsec3) {
|
||||
type == dns_rdatatype_nsec3)
|
||||
{
|
||||
(*callbacks->error)(
|
||||
callbacks, "%s:%lu: %s: %s",
|
||||
source, line, namebuf, desc);
|
||||
|
|
@ -2063,7 +2076,8 @@ load_text(dns_loadctx_t *lctx) {
|
|||
}
|
||||
|
||||
if ((lctx->options & DNS_MASTER_CHECKTTL) != 0 &&
|
||||
lctx->ttl > lctx->maxttl) {
|
||||
lctx->ttl > lctx->maxttl)
|
||||
{
|
||||
(callbacks->error)(callbacks,
|
||||
"dns_master_load: %s:%lu: "
|
||||
"TTL %d exceeds configured "
|
||||
|
|
@ -2490,7 +2504,8 @@ load_raw(dns_loadctx_t *lctx) {
|
|||
}
|
||||
|
||||
if ((lctx->options & DNS_MASTER_CHECKTTL) != 0 &&
|
||||
rdatalist.ttl > lctx->maxttl) {
|
||||
rdatalist.ttl > lctx->maxttl)
|
||||
{
|
||||
(callbacks->error)(callbacks,
|
||||
"dns_master_load: "
|
||||
"TTL %d exceeds configured "
|
||||
|
|
@ -2521,7 +2536,8 @@ load_raw(dns_loadctx_t *lctx) {
|
|||
dns_rdata_init(&rdata[i]);
|
||||
|
||||
if (sequential_read &&
|
||||
isc_buffer_availablelength(&target) < MINTSIZ) {
|
||||
isc_buffer_availablelength(&target) < MINTSIZ)
|
||||
{
|
||||
unsigned int j;
|
||||
|
||||
INSIST(i > 0); /* detect an infinite loop */
|
||||
|
|
|
|||
|
|
@ -664,7 +664,8 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
INDENT_TO(class_column);
|
||||
class_start = target->used;
|
||||
if ((ctx->style.flags & DNS_STYLEFLAG_UNKNOWNFORMAT) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
result = dns_rdataclass_tounknowntext(
|
||||
rdataset->rdclass, target);
|
||||
} else {
|
||||
|
|
@ -697,7 +698,8 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
#define KEYDATA "KEYDATA"
|
||||
if ((ctx->style.flags & DNS_STYLEFLAG_KEYDATA) != 0) {
|
||||
if (isc_buffer_availablelength(target) <
|
||||
(sizeof(KEYDATA) - 1)) {
|
||||
(sizeof(KEYDATA) - 1))
|
||||
{
|
||||
return (ISC_R_NOSPACE);
|
||||
}
|
||||
isc_buffer_putstr(target, KEYDATA);
|
||||
|
|
@ -706,7 +708,8 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
FALLTHROUGH;
|
||||
default:
|
||||
if ((ctx->style.flags & DNS_STYLEFLAG_UNKNOWNFORMAT) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
result = dns_rdatatype_tounknowntext(type,
|
||||
target);
|
||||
} else {
|
||||
|
|
@ -932,7 +935,8 @@ dump_rdataset(isc_mem_t *mctx, const dns_name_t *name, dns_rdataset_t *rdataset,
|
|||
|
||||
if ((ctx->style.flags & DNS_STYLEFLAG_TTL) != 0) {
|
||||
if (!ctx->current_ttl_valid ||
|
||||
ctx->current_ttl != rdataset->ttl) {
|
||||
ctx->current_ttl != rdataset->ttl)
|
||||
{
|
||||
if ((ctx->style.flags & DNS_STYLEFLAG_COMMENT) != 0) {
|
||||
isc_buffer_clear(buffer);
|
||||
result = dns_ttl_totext(rdataset->ttl, true,
|
||||
|
|
@ -1078,7 +1082,8 @@ again:
|
|||
dns_rdataset_t *rds = sorted[i];
|
||||
|
||||
if (ANCIENT(rds) &&
|
||||
(ctx->style.flags & DNS_STYLEFLAG_EXPIRED) == 0) {
|
||||
(ctx->style.flags & DNS_STYLEFLAG_EXPIRED) == 0)
|
||||
{
|
||||
/* Omit expired entries */
|
||||
dns_rdataset_disassociate(rds);
|
||||
continue;
|
||||
|
|
@ -1223,7 +1228,8 @@ restart:
|
|||
* continue?).
|
||||
*/
|
||||
if (isc_buffer_availablelength(buffer) <
|
||||
sizeof(dlen) + r.length) {
|
||||
sizeof(dlen) + r.length)
|
||||
{
|
||||
int newlength;
|
||||
void *newmem;
|
||||
|
||||
|
|
@ -1736,7 +1742,8 @@ dumptostream(dns_dumpctx_t *dctx) {
|
|||
result = dns_dbiterator_origin(dctx->dbiter, origin);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
if ((dctx->tctx.style.flags & DNS_STYLEFLAG_REL_DATA) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
dctx->tctx.origin = origin;
|
||||
}
|
||||
dctx->tctx.neworigin = origin;
|
||||
|
|
|
|||
|
|
@ -822,7 +822,8 @@ dns_message_find(const dns_name_t *name, dns_rdataclass_t rdclass,
|
|||
curr = ISC_LIST_PREV(curr, link))
|
||||
{
|
||||
if (curr->rdclass == rdclass && curr->type == type &&
|
||||
curr->covers == covers) {
|
||||
curr->covers == covers)
|
||||
{
|
||||
if (rdataset != NULL) {
|
||||
*rdataset = curr;
|
||||
}
|
||||
|
|
@ -1328,7 +1329,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
tkeysection = DNS_SECTION_ANSWER;
|
||||
}
|
||||
if (sectionid != tkeysection &&
|
||||
sectionid != DNS_SECTION_ANSWER) {
|
||||
sectionid != DNS_SECTION_ANSWER)
|
||||
{
|
||||
DO_ERROR(DNS_R_FORMERR);
|
||||
}
|
||||
}
|
||||
|
|
@ -1356,7 +1358,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
goto cleanup;
|
||||
}
|
||||
if (msg->opcode == dns_opcode_update &&
|
||||
update(sectionid, rdclass)) {
|
||||
update(sectionid, rdclass))
|
||||
{
|
||||
if (rdatalen != 0) {
|
||||
result = DNS_R_FORMERR;
|
||||
goto cleanup;
|
||||
|
|
@ -1394,7 +1397,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
DO_ERROR(DNS_R_FORMERR);
|
||||
}
|
||||
} else if (rdtype == dns_rdatatype_sig /* SIG(0) */ &&
|
||||
rdata->flags == 0) {
|
||||
rdata->flags == 0)
|
||||
{
|
||||
covers = dns_rdata_covers(rdata);
|
||||
if (covers == 0) {
|
||||
if (sectionid != DNS_SECTION_ADDITIONAL ||
|
||||
|
|
@ -1409,7 +1413,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
}
|
||||
} else {
|
||||
if (msg->rdclass != dns_rdataclass_any &&
|
||||
msg->rdclass != rdclass) {
|
||||
msg->rdclass != rdclass)
|
||||
{
|
||||
DO_ERROR(DNS_R_FORMERR);
|
||||
}
|
||||
}
|
||||
|
|
@ -1433,7 +1438,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
* to the end of the message.
|
||||
*/
|
||||
if (preserve_order || msg->opcode == dns_opcode_update ||
|
||||
skip_name_search) {
|
||||
skip_name_search)
|
||||
{
|
||||
if (!isedns && !istsig && !issigzero) {
|
||||
ISC_LIST_APPEND(*section, name, link);
|
||||
free_name = false;
|
||||
|
|
@ -1464,7 +1470,8 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
|
|||
* Skip this stage if in update mode or this is a meta-type.
|
||||
*/
|
||||
if (preserve_order || msg->opcode == dns_opcode_update ||
|
||||
skip_type_search) {
|
||||
skip_type_search)
|
||||
{
|
||||
result = ISC_R_NOTFOUND;
|
||||
} else {
|
||||
/*
|
||||
|
|
@ -2056,7 +2063,8 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
|
|||
next_rdataset = ISC_LIST_NEXT(rdataset, link);
|
||||
|
||||
if ((rdataset->attributes &
|
||||
DNS_RDATASETATTR_RENDERED) != 0) {
|
||||
DNS_RDATASETATTR_RENDERED) != 0)
|
||||
{
|
||||
goto next;
|
||||
}
|
||||
|
||||
|
|
@ -2264,7 +2272,8 @@ dns_message_renderend(dns_message_t *msg) {
|
|||
|
||||
/* Check PAD */
|
||||
if ((cp[-4] != 0) || (cp[-3] != DNS_OPT_PAD) || (cp[-2] != 0) ||
|
||||
(cp[-1] != 0)) {
|
||||
(cp[-1] != 0))
|
||||
{
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
|
|
@ -3090,7 +3099,8 @@ dns_message_signer(dns_message_t *msg, dns_name_t *signer) {
|
|||
{
|
||||
result = ISC_R_SUCCESS;
|
||||
} else if ((!msg->verified_sig) ||
|
||||
(msg->tsigstatus != dns_rcode_noerror)) {
|
||||
(msg->tsigstatus != dns_rcode_noerror))
|
||||
{
|
||||
result = DNS_R_TSIGVERIFYFAILURE;
|
||||
} else {
|
||||
INSIST(tsig.error != dns_rcode_noerror);
|
||||
|
|
@ -3238,7 +3248,8 @@ dns_message_checksig(dns_message_t *msg, dns_view_t *view) {
|
|||
result = dns_rdataset_first(&keyset);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
for (; result == ISC_R_SUCCESS;
|
||||
result = dns_rdataset_next(&keyset)) {
|
||||
result = dns_rdataset_next(&keyset))
|
||||
{
|
||||
dst_key_t *key = NULL;
|
||||
|
||||
dns_rdata_reset(&rdata);
|
||||
|
|
@ -3346,13 +3357,15 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
|||
rdataset = ISC_LIST_NEXT(rdataset, link))
|
||||
{
|
||||
if (section == DNS_SECTION_ANSWER &&
|
||||
rdataset->type == dns_rdatatype_soa) {
|
||||
rdataset->type == dns_rdatatype_soa)
|
||||
{
|
||||
if ((flags & DNS_MESSAGETEXTFLAG_OMITSOA) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (seensoa &&
|
||||
(flags & DNS_MESSAGETEXTFLAG_ONESOA) != 0) {
|
||||
(flags & DNS_MESSAGETEXTFLAG_ONESOA) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
seensoa = true;
|
||||
|
|
@ -3811,7 +3824,8 @@ dns_message_pseudosectiontoyaml(dns_message_t *msg, dns_pseudosection_t section,
|
|||
}
|
||||
for (i = 0; i < optlen; i++) {
|
||||
if (isprint(optdata[i]) ||
|
||||
(utf8ok && optdata[i] > 127)) {
|
||||
(utf8ok && optdata[i] > 127))
|
||||
{
|
||||
isc_buffer_putmem(
|
||||
target, &optdata[i], 1);
|
||||
} else {
|
||||
|
|
@ -4167,7 +4181,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg, dns_pseudosection_t section,
|
|||
}
|
||||
for (i = 0; i < optlen; i++) {
|
||||
if (isprint(optdata[i]) ||
|
||||
(utf8ok && optdata[i] > 127)) {
|
||||
(utf8ok && optdata[i] > 127))
|
||||
{
|
||||
isc_buffer_putmem(
|
||||
target, &optdata[i], 1);
|
||||
} else {
|
||||
|
|
@ -4634,7 +4649,8 @@ dns_message_buildopt(dns_message_t *message, dns_rdataset_t **rdatasetp,
|
|||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (ednsopts[i].code == DNS_OPT_PAD &&
|
||||
ednsopts[i].length == 0U && !seenpad) {
|
||||
ednsopts[i].length == 0U && !seenpad)
|
||||
{
|
||||
seenpad = true;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4748,7 +4764,8 @@ message_authority_soa_min(dns_message_t *msg, dns_ttl_t *pttl) {
|
|||
isc_result_t tresult;
|
||||
|
||||
if ((rdataset->attributes &
|
||||
DNS_RDATASETATTR_RENDERED) == 0) {
|
||||
DNS_RDATASETATTR_RENDERED) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -833,7 +833,8 @@ dns_name_issubdomain(const dns_name_t *name1, const dns_name_t *name2) {
|
|||
|
||||
namereln = dns_name_fullcompare(name1, name2, &order, &nlabels);
|
||||
if (namereln == dns_namereln_subdomain ||
|
||||
namereln == dns_namereln_equal) {
|
||||
namereln == dns_namereln_equal)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
|
@ -1417,7 +1418,8 @@ dns_name_totext2(const dns_name_t *name, unsigned int options,
|
|||
case 0x40: /* '@' */
|
||||
case 0x24: /* '$' */
|
||||
if ((options & DNS_NAME_MASTERFILE) ==
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
goto no_escape;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ addoptout(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
|||
rdataset = ISC_LIST_NEXT(rdataset, link))
|
||||
{
|
||||
if ((rdataset->attributes &
|
||||
DNS_RDATASETATTR_NCACHE) == 0) {
|
||||
DNS_RDATASETATTR_NCACHE) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
type = rdataset->type;
|
||||
|
|
@ -641,7 +642,8 @@ dns_ncache_getsigrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name,
|
|||
isc_region_consume(&remaining, 2);
|
||||
|
||||
if (type != dns_rdatatype_rrsig ||
|
||||
!dns_name_equal(&tname, name)) {
|
||||
!dns_name_equal(&tname, name))
|
||||
{
|
||||
result = dns_rdataset_next(&rclone);
|
||||
dns_rdata_reset(&rdata);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,8 @@ dns_nsec_buildrdata(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
|
|||
{
|
||||
for (i = 0; i <= max_type; i++) {
|
||||
if (dns_nsec_isset(bm, i) &&
|
||||
!dns_rdatatype_iszonecutauth((dns_rdatatype_t)i)) {
|
||||
!dns_rdatatype_iszonecutauth((dns_rdatatype_t)i))
|
||||
{
|
||||
dns_nsec_setbit(bm, i, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -296,7 +297,8 @@ dns_nsec_nseconly(dns_db_t *db, dns_dbversion_t *version, dns_diff_t *diff,
|
|||
{
|
||||
if (tuple->rdata.type !=
|
||||
dns_rdatatype_dnskey ||
|
||||
tuple->op != DNS_DIFFOP_DEL) {
|
||||
tuple->op != DNS_DIFFOP_DEL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ dns_nsec3_buildrdata(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
|
|||
* a NS record but do have other data.
|
||||
*/
|
||||
if (rdataset.type == dns_rdatatype_soa ||
|
||||
rdataset.type == dns_rdatatype_ds) {
|
||||
rdataset.type == dns_rdatatype_ds)
|
||||
{
|
||||
need_rrsig = true;
|
||||
} else if (rdataset.type == dns_rdatatype_ns) {
|
||||
found_ns = true;
|
||||
|
|
@ -170,7 +171,8 @@ dns_nsec3_buildrdata(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
|
|||
{
|
||||
for (i = 0; i <= max_type; i++) {
|
||||
if (dns_nsec_isset(bm, i) &&
|
||||
!dns_rdatatype_iszonecutauth((dns_rdatatype_t)i)) {
|
||||
!dns_rdatatype_iszonecutauth((dns_rdatatype_t)i))
|
||||
{
|
||||
dns_nsec_setbit(bm, i, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -486,7 +488,8 @@ better_param(dns_rdataset_t *nsec3paramset, dns_rdata_t *param) {
|
|||
dns_rdata_t tmprdata = DNS_RDATA_INIT;
|
||||
dns_rdataset_current(&rdataset, &tmprdata);
|
||||
if (!dns_nsec3param_fromprivate(&tmprdata, &rdata, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1311,7 +1314,8 @@ try_private:
|
|||
|
||||
dns_rdataset_current(&prdataset, &rdata1);
|
||||
if (!dns_nsec3param_fromprivate(&rdata1, &rdata2, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
CHECK(dns_rdata_tostruct(&rdata2, &nsec3param, NULL));
|
||||
|
|
@ -1740,7 +1744,8 @@ try_private:
|
|||
|
||||
dns_rdataset_current(&rdataset, &rdata1);
|
||||
if (!dns_nsec3param_fromprivate(&rdata1, &rdata2, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
CHECK(dns_rdata_tostruct(&rdata2, &nsec3param, NULL));
|
||||
|
|
@ -1858,7 +1863,8 @@ try_private:
|
|||
|
||||
dns_rdataset_current(&rdataset, &rdata1);
|
||||
if (!dns_nsec3param_fromprivate(&rdata1, &rdata2, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
result = dns_rdata_tostruct(&rdata2, &nsec3param, NULL);
|
||||
|
|
@ -1966,7 +1972,8 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, const dns_name_t *name,
|
|||
* Is this zone the same or deeper than the current zone?
|
||||
*/
|
||||
if (dns_name_countlabels(zonename) == 0 ||
|
||||
dns_name_issubdomain(zone, zonename)) {
|
||||
dns_name_issubdomain(zone, zonename))
|
||||
{
|
||||
dns_name_copy(zone, zonename);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ toresult(isc_result_t fallback) {
|
|||
default:
|
||||
#if defined(ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED)
|
||||
if (lib == ERR_R_ECDSA_LIB &&
|
||||
reason == ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED) {
|
||||
reason == ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED)
|
||||
{
|
||||
result = ISC_R_NOENTROPY;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,7 +220,8 @@ openssldh_compare(const dst_key_t *key1, const dst_key_t *key2) {
|
|||
|
||||
if (priv_key1 != NULL || priv_key2 != NULL) {
|
||||
if (priv_key1 == NULL || priv_key2 == NULL ||
|
||||
BN_cmp(priv_key1, priv_key2) != 0) {
|
||||
BN_cmp(priv_key1, priv_key2) != 0)
|
||||
{
|
||||
DST_RET(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -398,7 +399,8 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
|
|||
* static parameters which we can use.
|
||||
*/
|
||||
if (key->key_size == 768 || key->key_size == 1024 ||
|
||||
key->key_size == 1536) {
|
||||
key->key_size == 1536)
|
||||
{
|
||||
if (key->key_size == 768) {
|
||||
p = BN_dup(bn768);
|
||||
} else if (key->key_size == 1024) {
|
||||
|
|
@ -463,14 +465,16 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
|
|||
}
|
||||
|
||||
if (!DH_generate_parameters_ex(dh, key->key_size, generator,
|
||||
cb)) {
|
||||
cb))
|
||||
{
|
||||
DST_RET(dst__openssl_toresult2("DH_generate_parameters_"
|
||||
"ex",
|
||||
DST_R_OPENSSLFAILURE));
|
||||
}
|
||||
#else
|
||||
if (OSSL_PARAM_BLD_push_int(bld, OSSL_PKEY_PARAM_DH_GENERATOR,
|
||||
generator) != 1) {
|
||||
generator) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult2("OSSL_PARAM_BLD_push_"
|
||||
"int",
|
||||
DST_R_OPENSSLFAILURE));
|
||||
|
|
@ -529,7 +533,8 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
|
|||
DST_R_OPENSSLFAILURE));
|
||||
}
|
||||
if (EVP_PKEY_paramgen(param_ctx, ¶m_pkey) != 1 ||
|
||||
param_pkey == NULL) {
|
||||
param_pkey == NULL)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult2("EVP_PKEY_paramgen",
|
||||
DST_R_OPENSSLFAILURE));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,14 +234,16 @@ opensslecdsa_adddata(dst_context_t *dctx, const isc_region_t *data) {
|
|||
|
||||
if (dctx->use == DO_SIGN) {
|
||||
if (EVP_DigestSignUpdate(evp_md_ctx, data->base,
|
||||
data->length) != 1) {
|
||||
data->length) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult3(dctx->category,
|
||||
"EVP_DigestSignUpdate",
|
||||
ISC_R_FAILURE));
|
||||
}
|
||||
} else {
|
||||
if (EVP_DigestVerifyUpdate(evp_md_ctx, data->base,
|
||||
data->length) != 1) {
|
||||
data->length) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult3(dctx->category,
|
||||
"EVP_DigestVerifyUpdate",
|
||||
ISC_R_FAILURE));
|
||||
|
|
@ -775,7 +777,8 @@ opensslecdsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
|
|||
memmove(buf + 1, r.base, len);
|
||||
cp = buf;
|
||||
if (o2i_ECPublicKey(&eckey, (const unsigned char **)&cp,
|
||||
(long)len + 1) == NULL) {
|
||||
(long)len + 1) == NULL)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult(DST_R_INVALIDPUBLICKEY));
|
||||
}
|
||||
if (EC_KEY_check_key(eckey) != 1) {
|
||||
|
|
@ -1008,7 +1011,8 @@ ecdsa_check(EVP_PKEY **pkey, EVP_PKEY *pubpkey) {
|
|||
DST_RET(ISC_R_FAILURE);
|
||||
}
|
||||
if (OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_PRIV_KEY,
|
||||
priv) != 1) {
|
||||
priv) != 1)
|
||||
{
|
||||
DST_RET(ISC_R_FAILURE);
|
||||
}
|
||||
if (OSSL_PARAM_BLD_push_octet_string(bld,
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@ openssleddsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
|
|||
dctx->category, "EVP_DigestSignInit", ISC_R_FAILURE));
|
||||
}
|
||||
if (EVP_DigestSign(ctx, sigreg.base, &siglen, tbsreg.base,
|
||||
tbsreg.length) != 1) {
|
||||
tbsreg.length) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult3(dctx->category, "EVP_DigestSign",
|
||||
DST_R_SIGNFAILURE));
|
||||
}
|
||||
|
|
@ -459,7 +460,8 @@ openssleddsa_tofile(const dst_key_t *key, const char *directory) {
|
|||
}
|
||||
buf = isc_mem_get(key->mctx, len);
|
||||
if (EVP_PKEY_get_raw_private_key(key->keydata.pkey, buf,
|
||||
&len) != 1) {
|
||||
&len) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult(ISC_R_FAILURE));
|
||||
}
|
||||
priv.elements[i].tag = TAG_EDDSA_PRIVATEKEY;
|
||||
|
|
|
|||
|
|
@ -299,7 +299,8 @@ opensslrsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
|
|||
#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L || OPENSSL_API_LEVEL < 30000 */
|
||||
|
||||
if (BN_cmp(d1, d2) != 0 || BN_cmp(p1, p2) != 0 ||
|
||||
BN_cmp(q1, q2) != 0) {
|
||||
BN_cmp(q1, q2) != 0)
|
||||
{
|
||||
DST_RET(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -1306,15 +1307,18 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
|
|||
}
|
||||
|
||||
if (n != NULL &&
|
||||
OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_N, n) != 1) {
|
||||
OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_N, n) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
||||
}
|
||||
if (e != NULL &&
|
||||
OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_E, e) != 1) {
|
||||
OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_E, e) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
||||
}
|
||||
if (d != NULL &&
|
||||
OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_D, d) != 1) {
|
||||
OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_RSA_D, d) != 1)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult(DST_R_OPENSSLFAILURE));
|
||||
}
|
||||
if (p != NULL &&
|
||||
|
|
@ -1363,7 +1367,8 @@ opensslrsa_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
|
|||
}
|
||||
|
||||
if (rsa_check(pkey, pub != NULL ? pub->keydata.pkey : NULL) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
DST_RET(dst__openssl_toresult(DST_R_INVALIDPRIVATEKEY));
|
||||
}
|
||||
#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L || OPENSSL_API_LEVEL < 30000 */
|
||||
|
|
|
|||
|
|
@ -111,7 +111,8 @@ dns_order_find(dns_order_t *order, const dns_name_t *name,
|
|||
continue;
|
||||
}
|
||||
if (ent->rdclass != rdclass &&
|
||||
ent->rdclass != dns_rdataclass_any) {
|
||||
ent->rdclass != dns_rdataclass_any)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (match(name, dns_fixedname_name(&ent->name))) {
|
||||
|
|
|
|||
|
|
@ -185,7 +185,8 @@ dns_peerlist_addpeer(dns_peerlist_t *peers, dns_peer_t *peer) {
|
|||
* More specifics to front of list.
|
||||
*/
|
||||
for (p = ISC_LIST_HEAD(peers->elements); p != NULL;
|
||||
p = ISC_LIST_NEXT(p, next)) {
|
||||
p = ISC_LIST_NEXT(p, next))
|
||||
{
|
||||
if (p->prefixlen < peer->prefixlen) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -210,7 +211,8 @@ dns_peerlist_peerbyaddr(dns_peerlist_t *servers, const isc_netaddr_t *addr,
|
|||
server = ISC_LIST_HEAD(servers->elements);
|
||||
while (server != NULL) {
|
||||
if (isc_netaddr_eqprefix(addr, &server->address,
|
||||
server->prefixlen)) {
|
||||
server->prefixlen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ ignore(dns_rdata_t *param, dns_rdataset_t *privateset) {
|
|||
|
||||
dns_rdataset_current(privateset, &private);
|
||||
if (!dns_nsec3param_fromprivate(&private, &rdata, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
|
|
@ -178,7 +179,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
|||
|
||||
dns_rdataset_current(&privateset, &private);
|
||||
if (!dns_nsec3param_fromprivate(&private, &rdata, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (REMOVE(rdata.data[1])) {
|
||||
|
|
@ -215,7 +217,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
|||
|
||||
dns_rdataset_current(&privateset, &private);
|
||||
if (!dns_nsec3param_fromprivate(&private, &rdata, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (CREATE(rdata.data[1])) {
|
||||
|
|
@ -283,7 +286,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
|||
|
||||
dns_rdataset_current(&privateset, &private);
|
||||
if (!dns_nsec3param_fromprivate(&private, &rdata, buf,
|
||||
sizeof(buf))) {
|
||||
sizeof(buf)))
|
||||
{
|
||||
/*
|
||||
* Look for record that says we are signing the
|
||||
* zone with a key.
|
||||
|
|
@ -347,7 +351,8 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
|
|||
isc_buffer_t b;
|
||||
|
||||
if (!dns_nsec3param_fromprivate(private, &rdata, nsec3buf,
|
||||
sizeof(nsec3buf))) {
|
||||
sizeof(nsec3buf)))
|
||||
{
|
||||
CHECK(ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -701,7 +701,8 @@ dns_rbt_addnode(dns_rbt_t *rbt, const dns_name_t *name, dns_rbtnode_t **nodep) {
|
|||
hash_node(rbt, new_current, new_name);
|
||||
|
||||
if (common_labels ==
|
||||
dns_name_countlabels(add_name)) {
|
||||
dns_name_countlabels(add_name))
|
||||
{
|
||||
/*
|
||||
* The name has been added by pushing
|
||||
* the not-in-common parts down to
|
||||
|
|
@ -776,7 +777,8 @@ dns_rbt_addname(dns_rbt_t *rbt, const dns_name_t *name, void *data) {
|
|||
* there is data associated with a node.
|
||||
*/
|
||||
if (result == ISC_R_SUCCESS ||
|
||||
(result == ISC_R_EXISTS && DATA(node) == NULL)) {
|
||||
(result == ISC_R_EXISTS && DATA(node) == NULL))
|
||||
{
|
||||
DATA(node) = data;
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
@ -1293,7 +1295,8 @@ dns_rbt_findnode(dns_rbt_t *rbt, const dns_name_t *name, dns_name_t *foundname,
|
|||
result2 = dns_rbtnodechain_prev(
|
||||
chain, NULL, NULL);
|
||||
if (result2 == ISC_R_SUCCESS ||
|
||||
result2 == DNS_R_NEWORIGIN) {
|
||||
result2 == DNS_R_NEWORIGIN)
|
||||
{
|
||||
/* Nothing. */
|
||||
} else if (result2 == ISC_R_NOMORE) {
|
||||
/*
|
||||
|
|
@ -1728,7 +1731,8 @@ maybe_rehash(dns_rbt_t *rbt, size_t newcount) {
|
|||
uint32_t newbits = rehash_bits(rbt, newcount);
|
||||
|
||||
if (rbt->hashbits[rbt->hindex] < newbits &&
|
||||
newbits <= RBT_HASH_MAX_BITS) {
|
||||
newbits <= RBT_HASH_MAX_BITS)
|
||||
{
|
||||
hashtable_rehash(rbt, newbits);
|
||||
}
|
||||
}
|
||||
|
|
@ -2153,7 +2157,8 @@ deletefromlevel(dns_rbtnode_t *item, dns_rbtnode_t **rootp) {
|
|||
INSIST(sibling != NULL);
|
||||
|
||||
if (IS_BLACK(LEFT(sibling)) &&
|
||||
IS_BLACK(RIGHT(sibling))) {
|
||||
IS_BLACK(RIGHT(sibling)))
|
||||
{
|
||||
MAKE_RED(sibling);
|
||||
child = parent;
|
||||
} else {
|
||||
|
|
@ -2189,7 +2194,8 @@ deletefromlevel(dns_rbtnode_t *item, dns_rbtnode_t **rootp) {
|
|||
INSIST(sibling != NULL);
|
||||
|
||||
if (IS_BLACK(LEFT(sibling)) &&
|
||||
IS_BLACK(RIGHT(sibling))) {
|
||||
IS_BLACK(RIGHT(sibling)))
|
||||
{
|
||||
MAKE_RED(sibling);
|
||||
child = parent;
|
||||
} else {
|
||||
|
|
@ -2340,7 +2346,8 @@ check_properties_helper(dns_rbtnode_t *node) {
|
|||
* a subtree root and must have the flag set.
|
||||
*/
|
||||
if (((!PARENT(node)) || (DOWN(PARENT(node)) == node)) &&
|
||||
(!IS_ROOT(node))) {
|
||||
(!IS_ROOT(node)))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
|
@ -2748,7 +2755,8 @@ dns_rbtnodechain_prev(dns_rbtnodechain_t *chain, dns_name_t *name,
|
|||
* the origin for the second level tree.
|
||||
*/
|
||||
if (origin != NULL &&
|
||||
(chain->level_count > 0 || OFFSETLEN(predecessor) > 1)) {
|
||||
(chain->level_count > 0 || OFFSETLEN(predecessor) > 1))
|
||||
{
|
||||
new_origin = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
195
lib/dns/rbtdb.c
195
lib/dns/rbtdb.c
|
|
@ -1478,7 +1478,8 @@ rollback_node(dns_rbtnode_t *node, rbtdb_serial_t serial) {
|
|||
make_dirty = true;
|
||||
}
|
||||
for (dcurrent = header->down; dcurrent != NULL;
|
||||
dcurrent = dcurrent->down) {
|
||||
dcurrent = dcurrent->down)
|
||||
{
|
||||
if (dcurrent->serial == serial) {
|
||||
RDATASET_ATTR_SET(dcurrent,
|
||||
RDATASET_ATTR_IGNORE);
|
||||
|
|
@ -1618,11 +1619,13 @@ clean_zone_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
|
|||
*/
|
||||
dparent = current;
|
||||
for (dcurrent = current->down; dcurrent != NULL;
|
||||
dcurrent = down_next) {
|
||||
dcurrent = down_next)
|
||||
{
|
||||
down_next = dcurrent->down;
|
||||
INSIST(dcurrent->serial <= dparent->serial);
|
||||
if (dcurrent->serial == dparent->serial ||
|
||||
IGNORE(dcurrent)) {
|
||||
IGNORE(dcurrent))
|
||||
{
|
||||
if (down_next != NULL) {
|
||||
down_next->next = dparent;
|
||||
}
|
||||
|
|
@ -1673,7 +1676,8 @@ clean_zone_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
|
|||
*/
|
||||
dparent = current;
|
||||
for (dcurrent = current->down; dcurrent != NULL;
|
||||
dcurrent = down_next) {
|
||||
dcurrent = down_next)
|
||||
{
|
||||
down_next = dcurrent->down;
|
||||
if (dcurrent->serial < least_serial) {
|
||||
break;
|
||||
|
|
@ -1867,7 +1871,8 @@ cleanup_dead_nodes(dns_rbtdb_t *rbtdb, int bucketnum) {
|
|||
* and we have to do it now.
|
||||
*/
|
||||
if (isc_refcount_current(&node->references) != 0 ||
|
||||
node->data != NULL) {
|
||||
node->data != NULL)
|
||||
{
|
||||
node = ISC_LIST_HEAD(rbtdb->deadnodes[bucketnum]);
|
||||
count--;
|
||||
continue;
|
||||
|
|
@ -2296,7 +2301,8 @@ setnsec3parameters(dns_db_t *db, rbtdb_version_t *version) {
|
|||
header_next = header->next;
|
||||
do {
|
||||
if (header->serial <= version->serial &&
|
||||
!IGNORE(header)) {
|
||||
!IGNORE(header))
|
||||
{
|
||||
if (NONEXISTENT(header)) {
|
||||
header = NULL;
|
||||
}
|
||||
|
|
@ -2307,7 +2313,8 @@ setnsec3parameters(dns_db_t *db, rbtdb_version_t *version) {
|
|||
} while (header != NULL);
|
||||
|
||||
if (header != NULL &&
|
||||
(header->type == dns_rdatatype_nsec3param)) {
|
||||
(header->type == dns_rdatatype_nsec3param))
|
||||
{
|
||||
/*
|
||||
* Find A NSEC3PARAM with a supported algorithm.
|
||||
*/
|
||||
|
|
@ -2578,7 +2585,8 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) {
|
|||
* Commit/rollback re-signed headers.
|
||||
*/
|
||||
for (header = HEAD(resigned_list); header != NULL;
|
||||
header = HEAD(resigned_list)) {
|
||||
header = HEAD(resigned_list))
|
||||
{
|
||||
nodelock_t *lock;
|
||||
|
||||
ISC_LIST_UNLINK(resigned_list, header, link);
|
||||
|
|
@ -2619,7 +2627,8 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp, bool commit) {
|
|||
}
|
||||
|
||||
for (changed = HEAD(cleanup_list); changed != NULL;
|
||||
changed = next_changed) {
|
||||
changed = next_changed)
|
||||
{
|
||||
nodelock_t *lock;
|
||||
|
||||
next_changed = NEXT(changed, link);
|
||||
|
|
@ -2861,7 +2870,8 @@ zone_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name, void *arg) {
|
|||
{
|
||||
do {
|
||||
if (header->serial <= search->serial &&
|
||||
!IGNORE(header)) {
|
||||
!IGNORE(header))
|
||||
{
|
||||
/*
|
||||
* Is this a "this rdataset doesn't
|
||||
* exist" record?
|
||||
|
|
@ -2878,10 +2888,12 @@ zone_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name, void *arg) {
|
|||
if (header->type == dns_rdatatype_dname) {
|
||||
dname_header = header;
|
||||
} else if (header->type ==
|
||||
RBTDB_RDATATYPE_SIGDNAME) {
|
||||
RBTDB_RDATATYPE_SIGDNAME)
|
||||
{
|
||||
sigdname_header = header;
|
||||
} else if (node != onode ||
|
||||
IS_STUB(search->rbtdb)) {
|
||||
IS_STUB(search->rbtdb))
|
||||
{
|
||||
/*
|
||||
* We've found an NS rdataset that
|
||||
* isn't at the origin node. We check
|
||||
|
|
@ -2900,7 +2912,8 @@ zone_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name, void *arg) {
|
|||
* Did we find anything?
|
||||
*/
|
||||
if (!IS_CACHE(search->rbtdb) && !IS_STUB(search->rbtdb) &&
|
||||
ns_header != NULL) {
|
||||
ns_header != NULL)
|
||||
{
|
||||
/*
|
||||
* Note that NS has precedence over DNAME if both exist
|
||||
* in a zone. Otherwise DNAME take precedence over NS.
|
||||
|
|
@ -3240,7 +3253,8 @@ activeempty(rbtdb_search_t *search, dns_rbtnodechain_t *chain,
|
|||
for (header = node->data; header != NULL; header = header->next)
|
||||
{
|
||||
if (header->serial <= search->serial &&
|
||||
!IGNORE(header) && EXISTS(header)) {
|
||||
!IGNORE(header) && EXISTS(header))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -3308,7 +3322,8 @@ activeemptynode(rbtdb_search_t *search, const dns_name_t *qname,
|
|||
for (header = node->data; header != NULL; header = header->next)
|
||||
{
|
||||
if (header->serial <= search->serial &&
|
||||
!IGNORE(header) && EXISTS(header)) {
|
||||
!IGNORE(header) && EXISTS(header))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -3338,7 +3353,8 @@ activeemptynode(rbtdb_search_t *search, const dns_name_t *qname,
|
|||
for (header = node->data; header != NULL; header = header->next)
|
||||
{
|
||||
if (header->serial <= search->serial &&
|
||||
!IGNORE(header) && EXISTS(header)) {
|
||||
!IGNORE(header) && EXISTS(header))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -3485,7 +3501,8 @@ find_wildcard(rbtdb_search_t *search, dns_rbtnode_t **nodep,
|
|||
lock = &rbtdb->node_locks[wnode->locknum].lock;
|
||||
NODE_LOCK(lock, isc_rwlocktype_read);
|
||||
for (header = wnode->data; header != NULL;
|
||||
header = header->next) {
|
||||
header = header->next)
|
||||
{
|
||||
if (header->serial <= search->serial &&
|
||||
!IGNORE(header) && EXISTS(header) &&
|
||||
!ANCIENT(header))
|
||||
|
|
@ -3495,9 +3512,11 @@ find_wildcard(rbtdb_search_t *search, dns_rbtnode_t **nodep,
|
|||
}
|
||||
NODE_UNLOCK(lock, isc_rwlocktype_read);
|
||||
if (header != NULL ||
|
||||
activeempty(search, &wchain, wname)) {
|
||||
activeempty(search, &wchain, wname))
|
||||
{
|
||||
if (activeemptynode(search, qname,
|
||||
wname)) {
|
||||
wname))
|
||||
{
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
/*
|
||||
|
|
@ -3510,7 +3529,8 @@ find_wildcard(rbtdb_search_t *search, dns_rbtnode_t **nodep,
|
|||
break;
|
||||
}
|
||||
} else if (result != ISC_R_NOTFOUND &&
|
||||
result != DNS_R_PARTIALMATCH) {
|
||||
result != DNS_R_PARTIALMATCH)
|
||||
{
|
||||
/*
|
||||
* An error has occurred. Bail out.
|
||||
*/
|
||||
|
|
@ -3636,7 +3656,8 @@ previous_closest_nsec(dns_rdatatype_t type, rbtdb_search_t *search,
|
|||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
} else if (result == ISC_R_NOTFOUND ||
|
||||
result == DNS_R_PARTIALMATCH) {
|
||||
result == DNS_R_PARTIALMATCH)
|
||||
{
|
||||
result = dns_rbtnodechain_current(
|
||||
nsecchain, name, origin, NULL);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
|
|
@ -3751,7 +3772,8 @@ again:
|
|||
*/
|
||||
do {
|
||||
if (header->serial <= search->serial &&
|
||||
!IGNORE(header)) {
|
||||
!IGNORE(header))
|
||||
{
|
||||
/*
|
||||
* Is this a "this rdataset doesn't
|
||||
* exist" record?
|
||||
|
|
@ -3795,7 +3817,8 @@ again:
|
|||
type, search, name, origin, &prevnode,
|
||||
NULL, NULL);
|
||||
} else if (found != NULL &&
|
||||
(foundsig != NULL || !need_sig)) {
|
||||
(foundsig != NULL || !need_sig))
|
||||
{
|
||||
/*
|
||||
* We've found the right NSEC/NSEC3 record.
|
||||
*
|
||||
|
|
@ -4144,7 +4167,8 @@ found:
|
|||
* we are using behave as if it isn't here.
|
||||
*/
|
||||
if (header->type == dns_rdatatype_nsec3 &&
|
||||
!matchparams(header, &search)) {
|
||||
!matchparams(header, &search))
|
||||
{
|
||||
NODE_UNLOCK(lock, isc_rwlocktype_read);
|
||||
goto partial_match;
|
||||
}
|
||||
|
|
@ -4160,7 +4184,8 @@ found:
|
|||
*/
|
||||
found = header;
|
||||
if (header->type == dns_rdatatype_cname &&
|
||||
cname_ok) {
|
||||
cname_ok)
|
||||
{
|
||||
/*
|
||||
* We may be finding a CNAME instead
|
||||
* of the desired type.
|
||||
|
|
@ -4195,7 +4220,8 @@ found:
|
|||
break;
|
||||
}
|
||||
} else if (header->type == dns_rdatatype_nsec &&
|
||||
!search.rbtversion->havensec3) {
|
||||
!search.rbtversion->havensec3)
|
||||
{
|
||||
/*
|
||||
* Remember a NSEC rdataset even if we're
|
||||
* not specifically looking for it, because
|
||||
|
|
@ -4211,7 +4237,8 @@ found:
|
|||
*/
|
||||
nsecsig = header;
|
||||
} else if (cname_ok &&
|
||||
header->type == RBTDB_RDATATYPE_SIGCNAME) {
|
||||
header->type == RBTDB_RDATATYPE_SIGCNAME)
|
||||
{
|
||||
/*
|
||||
* If we get a CNAME match, we'll also need
|
||||
* its signature.
|
||||
|
|
@ -4278,7 +4305,8 @@ found:
|
|||
goto tree_exit;
|
||||
}
|
||||
if ((search.options & DNS_DBFIND_FORCENSEC) != 0 &&
|
||||
nsecheader == NULL) {
|
||||
nsecheader == NULL)
|
||||
{
|
||||
/*
|
||||
* There's no NSEC record, and we were told
|
||||
* to find one.
|
||||
|
|
@ -4458,7 +4486,8 @@ check_stale_header(dns_rbtnode_t *node, rdatasetheader_t *header,
|
|||
|
||||
RDATASET_ATTR_CLR(header, RDATASET_ATTR_STALE_WINDOW);
|
||||
if (!ZEROTTL(header) && KEEPSTALE(search->rbtdb) &&
|
||||
stale > search->now) {
|
||||
stale > search->now)
|
||||
{
|
||||
mark_header_stale(search->rbtdb, header);
|
||||
*header_prev = header;
|
||||
/*
|
||||
|
|
@ -4488,7 +4517,8 @@ check_stale_header(dns_rbtnode_t *node, rdatasetheader_t *header,
|
|||
RDATASET_ATTR_STALE_WINDOW);
|
||||
return (false);
|
||||
} else if ((search->options &
|
||||
DNS_DBFIND_STALETIMEOUT) != 0) {
|
||||
DNS_DBFIND_STALETIMEOUT) != 0)
|
||||
{
|
||||
/*
|
||||
* We want stale RRset due to timeout, so we
|
||||
* don't skip it.
|
||||
|
|
@ -4581,7 +4611,8 @@ cache_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name, void *arg) {
|
|||
for (header = node->data; header != NULL; header = header_next) {
|
||||
header_next = header->next;
|
||||
if (check_stale_header(node, header, &locktype, lock, search,
|
||||
&header_prev)) {
|
||||
&header_prev))
|
||||
{
|
||||
/* Do nothing. */
|
||||
} else if (header->type == dns_rdatatype_dname &&
|
||||
EXISTS(header) && !ANCIENT(header))
|
||||
|
|
@ -4658,7 +4689,8 @@ find_deepest_zonecut(rbtdb_search_t *search, dns_rbtnode_t *node,
|
|||
{
|
||||
header_next = header->next;
|
||||
if (check_stale_header(node, header, &locktype, lock,
|
||||
search, &header_prev)) {
|
||||
search, &header_prev))
|
||||
{
|
||||
/* Do nothing. */
|
||||
} else if (EXISTS(header) && !ANCIENT(header)) {
|
||||
/*
|
||||
|
|
@ -4671,7 +4703,8 @@ find_deepest_zonecut(rbtdb_search_t *search, dns_rbtnode_t *node,
|
|||
break;
|
||||
}
|
||||
} else if (header->type ==
|
||||
RBTDB_RDATATYPE_SIGNS) {
|
||||
RBTDB_RDATATYPE_SIGNS)
|
||||
{
|
||||
foundsig = header;
|
||||
if (found != NULL) {
|
||||
break;
|
||||
|
|
@ -4739,7 +4772,8 @@ find_deepest_zonecut(rbtdb_search_t *search, dns_rbtnode_t *node,
|
|||
search->now);
|
||||
}
|
||||
if (foundsig != NULL &&
|
||||
need_headerupdate(foundsig, search->now)) {
|
||||
need_headerupdate(foundsig, search->now))
|
||||
{
|
||||
update_header(search->rbtdb, foundsig,
|
||||
search->now);
|
||||
}
|
||||
|
|
@ -4836,11 +4870,13 @@ find_coveringnsec(rbtdb_search_t *search, const dns_name_t *name,
|
|||
for (header = node->data; header != NULL; header = header_next) {
|
||||
header_next = header->next;
|
||||
if (check_stale_header(node, header, &locktype, lock, search,
|
||||
&header_prev)) {
|
||||
&header_prev))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (NONEXISTENT(header) ||
|
||||
RBTDB_RDATATYPE_BASE(header->type) == 0) {
|
||||
RBTDB_RDATATYPE_BASE(header->type) == 0)
|
||||
{
|
||||
header_prev = header;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4999,7 +5035,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
for (header = node->data; header != NULL; header = header_next) {
|
||||
header_next = header->next;
|
||||
if (check_stale_header(node, header, &locktype, lock, &search,
|
||||
&header_prev)) {
|
||||
&header_prev))
|
||||
{
|
||||
/* Do nothing. */
|
||||
} else if (EXISTS(header) && !ANCIENT(header)) {
|
||||
/*
|
||||
|
|
@ -5008,7 +5045,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
*/
|
||||
empty_node = false;
|
||||
if (header->noqname != NULL &&
|
||||
header->trust == dns_trust_secure) {
|
||||
header->trust == dns_trust_secure)
|
||||
{
|
||||
found_noqname = true;
|
||||
}
|
||||
if (!NEGATIVE(header)) {
|
||||
|
|
@ -5029,7 +5067,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
*/
|
||||
found = header;
|
||||
if (header->type == dns_rdatatype_cname &&
|
||||
cname_ok && cnamesig != NULL) {
|
||||
cname_ok && cnamesig != NULL)
|
||||
{
|
||||
/*
|
||||
* If we've already got the
|
||||
* CNAME RRSIG, use it.
|
||||
|
|
@ -5043,7 +5082,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
*/
|
||||
foundsig = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_NCACHEANY ||
|
||||
header->type == negtype) {
|
||||
header->type == negtype)
|
||||
{
|
||||
/*
|
||||
* We've found a negative cache entry.
|
||||
*/
|
||||
|
|
@ -5066,7 +5106,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
} else if (header->type == RBTDB_RDATATYPE_SIGNSEC) {
|
||||
nsecsig = header;
|
||||
} else if (cname_ok &&
|
||||
header->type == RBTDB_RDATATYPE_SIGCNAME) {
|
||||
header->type == RBTDB_RDATATYPE_SIGCNAME)
|
||||
{
|
||||
/*
|
||||
* If we get a CNAME match, we'll also need
|
||||
* its signature.
|
||||
|
|
@ -5112,7 +5153,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
* Return covering NODATA NSEC record.
|
||||
*/
|
||||
if ((search.options & DNS_DBFIND_COVERINGNSEC) != 0 &&
|
||||
nsecheader != NULL) {
|
||||
nsecheader != NULL)
|
||||
{
|
||||
if (nodep != NULL) {
|
||||
new_reference(search.rbtdb, node, locktype);
|
||||
*nodep = node;
|
||||
|
|
@ -5236,7 +5278,8 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
|||
|
||||
node_exit:
|
||||
if ((update != NULL || updatesig != NULL) &&
|
||||
locktype != isc_rwlocktype_write) {
|
||||
locktype != isc_rwlocktype_write)
|
||||
{
|
||||
NODE_UNLOCK(lock, locktype);
|
||||
NODE_LOCK(lock, isc_rwlocktype_write);
|
||||
locktype = isc_rwlocktype_write;
|
||||
|
|
@ -5349,7 +5392,8 @@ cache_findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options,
|
|||
for (header = node->data; header != NULL; header = header_next) {
|
||||
header_next = header->next;
|
||||
if (check_stale_header(node, header, &locktype, lock, &search,
|
||||
&header_prev)) {
|
||||
&header_prev))
|
||||
{
|
||||
/*
|
||||
* The function dns_rbt_findnode found us the a matching
|
||||
* node for 'name' and stored the result in 'dcname'.
|
||||
|
|
@ -5480,7 +5524,8 @@ detachnode(dns_db_t *db, dns_dbnode_t **targetp) {
|
|||
isc_rwlocktype_none, false))
|
||||
{
|
||||
if (isc_refcount_current(&nodelock->references) == 0 &&
|
||||
nodelock->exiting) {
|
||||
nodelock->exiting)
|
||||
{
|
||||
inactive = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -5570,7 +5615,8 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {
|
|||
|
||||
for (header = rbtnode->data; header != NULL; header = header->next) {
|
||||
if (header->rdh_ttl + rbtdb->serve_stale_ttl <=
|
||||
now - RBTDB_VIRTUAL) {
|
||||
now - RBTDB_VIRTUAL)
|
||||
{
|
||||
/*
|
||||
* We don't check if refcurrent(rbtnode) == 0 and try
|
||||
* to free like we do in cache_find(), because
|
||||
|
|
@ -5634,7 +5680,8 @@ printnode(dns_db_t *db, dns_dbnode_t *node, FILE *out) {
|
|||
rdatasetheader_t *current, *top_next;
|
||||
|
||||
for (current = rbtnode->data; current != NULL;
|
||||
current = top_next) {
|
||||
current = top_next)
|
||||
{
|
||||
top_next = current->next;
|
||||
first = true;
|
||||
fprintf(out, "\ttype %u", current->type);
|
||||
|
|
@ -5865,7 +5912,8 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
if (header->type == matchtype) {
|
||||
found = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_NCACHEANY ||
|
||||
header->type == negtype) {
|
||||
header->type == negtype)
|
||||
{
|
||||
found = header;
|
||||
} else if (header->type == sigmatchtype) {
|
||||
foundsig = header;
|
||||
|
|
@ -6004,7 +6052,8 @@ cname_and_other_data(dns_rbtnode_t *node, rbtdb_serial_t serial) {
|
|||
*/
|
||||
do {
|
||||
if (header->serial <= serial &&
|
||||
!IGNORE(header)) {
|
||||
!IGNORE(header))
|
||||
{
|
||||
/*
|
||||
* Is this a "this rdataset
|
||||
* doesn't exist" record?
|
||||
|
|
@ -6165,7 +6214,8 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, const dns_name_t *nodename,
|
|||
*/
|
||||
for (topheader = rbtnode->data;
|
||||
topheader != NULL;
|
||||
topheader = topheader->next) {
|
||||
topheader = topheader->next)
|
||||
{
|
||||
set_ttl(rbtdb, topheader, 0);
|
||||
mark_header_ancient(rbtdb, topheader);
|
||||
}
|
||||
|
|
@ -6176,7 +6226,8 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, const dns_name_t *nodename,
|
|||
* type so they can be marked ancient later.
|
||||
*/
|
||||
for (topheader = rbtnode->data; topheader != NULL;
|
||||
topheader = topheader->next) {
|
||||
topheader = topheader->next)
|
||||
{
|
||||
if (topheader->type == sigtype) {
|
||||
sigheader = topheader;
|
||||
}
|
||||
|
|
@ -6192,7 +6243,8 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, const dns_name_t *nodename,
|
|||
* entry which covers the same type as the RRSIG.
|
||||
*/
|
||||
for (topheader = rbtnode->data; topheader != NULL;
|
||||
topheader = topheader->next) {
|
||||
topheader = topheader->next)
|
||||
{
|
||||
if ((topheader->type ==
|
||||
RBTDB_RDATATYPE_NCACHEANY) ||
|
||||
(newheader->type == sigtype &&
|
||||
|
|
@ -6203,7 +6255,8 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, const dns_name_t *nodename,
|
|||
}
|
||||
}
|
||||
if (topheader != NULL && EXISTS(topheader) &&
|
||||
ACTIVE(topheader, now)) {
|
||||
ACTIVE(topheader, now))
|
||||
{
|
||||
/*
|
||||
* Found one.
|
||||
*/
|
||||
|
|
@ -6237,9 +6290,11 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, const dns_name_t *nodename,
|
|||
}
|
||||
|
||||
for (topheader = rbtnode->data; topheader != NULL;
|
||||
topheader = topheader->next) {
|
||||
topheader = topheader->next)
|
||||
{
|
||||
if (topheader->type == newheader->type ||
|
||||
topheader->type == negtype) {
|
||||
topheader->type == negtype)
|
||||
{
|
||||
break;
|
||||
}
|
||||
topheader_prev = topheader;
|
||||
|
|
@ -6379,12 +6434,14 @@ find_header:
|
|||
set_ttl(rbtdb, header, newheader->rdh_ttl);
|
||||
}
|
||||
if (header->noqname == NULL &&
|
||||
newheader->noqname != NULL) {
|
||||
newheader->noqname != NULL)
|
||||
{
|
||||
header->noqname = newheader->noqname;
|
||||
newheader->noqname = NULL;
|
||||
}
|
||||
if (header->closest == NULL &&
|
||||
newheader->closest != NULL) {
|
||||
newheader->closest != NULL)
|
||||
{
|
||||
header->closest = newheader->closest;
|
||||
newheader->closest = NULL;
|
||||
}
|
||||
|
|
@ -6429,12 +6486,14 @@ find_header:
|
|||
set_ttl(rbtdb, header, newheader->rdh_ttl);
|
||||
}
|
||||
if (header->noqname == NULL &&
|
||||
newheader->noqname != NULL) {
|
||||
newheader->noqname != NULL)
|
||||
{
|
||||
header->noqname = newheader->noqname;
|
||||
newheader->noqname = NULL;
|
||||
}
|
||||
if (header->closest == NULL &&
|
||||
newheader->closest != NULL) {
|
||||
newheader->closest != NULL)
|
||||
{
|
||||
header->closest = newheader->closest;
|
||||
newheader->closest = NULL;
|
||||
}
|
||||
|
|
@ -6602,7 +6661,8 @@ find_header:
|
|||
* Check if the node now contains CNAME and other data.
|
||||
*/
|
||||
if (rbtversion != NULL &&
|
||||
cname_and_other_data(rbtnode, rbtversion->serial)) {
|
||||
cname_and_other_data(rbtnode, rbtversion->serial))
|
||||
{
|
||||
return (DNS_R_CNAMEANDOTHER);
|
||||
}
|
||||
|
||||
|
|
@ -6750,7 +6810,8 @@ addrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
* SOA records are only allowed at top of zone.
|
||||
*/
|
||||
if (rdataset->type == dns_rdatatype_soa &&
|
||||
node != rbtdb->origin_node) {
|
||||
node != rbtdb->origin_node)
|
||||
{
|
||||
return (DNS_R_NOTZONETOP);
|
||||
}
|
||||
RWLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
|
||||
|
|
@ -7038,7 +7099,8 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
|
||||
topheader_prev = NULL;
|
||||
for (topheader = rbtnode->data; topheader != NULL;
|
||||
topheader = topheader->next) {
|
||||
topheader = topheader->next)
|
||||
{
|
||||
if (topheader->type == newheader->type) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -7438,7 +7500,8 @@ loading_addrdataset(void *arg, const dns_name_t *name,
|
|||
isc_rwlocktype_write);
|
||||
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
delegating_type(rbtdb, node, rdataset->type)) {
|
||||
delegating_type(rbtdb, node, rdataset->type))
|
||||
{
|
||||
node->find_callback = 1;
|
||||
} else if (result == DNS_R_UNCHANGED) {
|
||||
result = ISC_R_SUCCESS;
|
||||
|
|
@ -9494,7 +9557,8 @@ rehash_bits(rbtdb_version_t *version, size_t newcount) {
|
|||
uint32_t newbits = oldbits;
|
||||
|
||||
while (newcount >= HASHSIZE(newbits) &&
|
||||
newbits <= RBTDB_GLUE_TABLE_MAX_BITS) {
|
||||
newbits <= RBTDB_GLUE_TABLE_MAX_BITS)
|
||||
{
|
||||
newbits += 1;
|
||||
}
|
||||
|
||||
|
|
@ -9525,7 +9589,8 @@ rehash_gluetable(rbtdb_version_t *version) {
|
|||
rbtdb_glue_table_node_t *gluenode;
|
||||
rbtdb_glue_table_node_t *nextgluenode;
|
||||
for (gluenode = oldtable[i]; gluenode != NULL;
|
||||
gluenode = nextgluenode) {
|
||||
gluenode = nextgluenode)
|
||||
{
|
||||
uint32_t hash = isc_hash32(
|
||||
&gluenode->node, sizeof(gluenode->node), true);
|
||||
uint32_t idx = hash_32(hash, newbits);
|
||||
|
|
|
|||
|
|
@ -219,7 +219,8 @@ maybe_numeric(unsigned int *valuep, isc_textregion_t *source, unsigned int max,
|
|||
int v;
|
||||
|
||||
if (!isdigit((unsigned char)source->base[0]) ||
|
||||
source->length > NUMBERSIZE - 1) {
|
||||
source->length > NUMBERSIZE - 1)
|
||||
{
|
||||
return (ISC_R_BADNUMBER);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -508,7 +508,8 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
|
|||
|
||||
for (i = 0; i < sr->length; i += len) {
|
||||
if (tctx != NULL &&
|
||||
(tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
|
||||
(tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
|
||||
{
|
||||
RETERR(str_totext(tctx->linebreak, target));
|
||||
first = true;
|
||||
}
|
||||
|
|
@ -987,7 +988,8 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
|
|||
|
||||
unknown = false;
|
||||
if (token.type == isc_tokentype_string &&
|
||||
strcmp(DNS_AS_STR(token), "\\#") == 0) {
|
||||
strcmp(DNS_AS_STR(token), "\\#") == 0)
|
||||
{
|
||||
/*
|
||||
* If this is a TXT record '\#' could be a escaped '#'.
|
||||
* Look to see if the next token is a number and if so
|
||||
|
|
@ -1035,7 +1037,8 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
|
|||
}
|
||||
break;
|
||||
} else if (token.type != isc_tokentype_eol &&
|
||||
token.type != isc_tokentype_eof) {
|
||||
token.type != isc_tokentype_eof)
|
||||
{
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
result = DNS_R_EXTRATOKEN;
|
||||
}
|
||||
|
|
@ -1111,7 +1114,8 @@ unknown_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
|
|||
tctx->linebreak, target);
|
||||
}
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
(tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) {
|
||||
(tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
|
||||
{
|
||||
result = str_totext(" )", target);
|
||||
}
|
||||
}
|
||||
|
|
@ -2195,7 +2199,8 @@ dns_rdatatype_issingleton(dns_rdatatype_t type) {
|
|||
bool
|
||||
dns_rdatatype_notquestion(dns_rdatatype_t type) {
|
||||
if ((dns_rdatatype_attributes(type) & DNS_RDATATYPEATTR_NOTQUESTION) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
return (false);
|
||||
|
|
@ -2204,7 +2209,8 @@ dns_rdatatype_notquestion(dns_rdatatype_t type) {
|
|||
bool
|
||||
dns_rdatatype_questiononly(dns_rdatatype_t type) {
|
||||
if ((dns_rdatatype_attributes(type) & DNS_RDATATYPEATTR_QUESTIONONLY) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
return (false);
|
||||
|
|
@ -2230,7 +2236,8 @@ dns_rdatatype_atparent(dns_rdatatype_t type) {
|
|||
bool
|
||||
dns_rdatatype_followadditional(dns_rdatatype_t type) {
|
||||
if ((dns_rdatatype_attributes(type) &
|
||||
DNS_RDATATYPEATTR_FOLLOWADDITIONAL) != 0) {
|
||||
DNS_RDATATYPEATTR_FOLLOWADDITIONAL) != 0)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
return (false);
|
||||
|
|
@ -2258,7 +2265,8 @@ dns_rdatatype_isdnssec(dns_rdatatype_t type) {
|
|||
bool
|
||||
dns_rdatatype_iszonecutauth(dns_rdatatype_t type) {
|
||||
if ((dns_rdatatype_attributes(type) & DNS_RDATATYPEATTR_ZONECUTAUTH) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
return (false);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) {
|
|||
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
|
||||
false));
|
||||
if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
i = strtol(DNS_AS_STR(token), &e, 10);
|
||||
if (*e != 0) {
|
||||
RETTOK(DNS_R_UNKNOWN);
|
||||
|
|
|
|||
|
|
@ -452,7 +452,8 @@ casecompare_amtrelay(ARGS_COMPARE) {
|
|||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
|
||||
if (memcmp(region1.base, region2.base, 2) != 0 ||
|
||||
(region1.base[1] & 0x7f) != 3) {
|
||||
(region1.base[1] & 0x7f) != 3)
|
||||
{
|
||||
return (isc_region_compare(®ion1, ®ion2));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -319,7 +319,8 @@ fromtext_caa(ARGS_FROMTEXT) {
|
|||
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring,
|
||||
false));
|
||||
if (token.type != isc_tokentype_qstring &&
|
||||
token.type != isc_tokentype_string) {
|
||||
token.type != isc_tokentype_string)
|
||||
{
|
||||
RETERR(DNS_R_SYNTAX);
|
||||
}
|
||||
RETERR(multitxt_fromtext(&token.value.as_textregion, target));
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ fromtext_isdn(ARGS_FROMTEXT) {
|
|||
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring,
|
||||
true));
|
||||
if (token.type != isc_tokentype_string &&
|
||||
token.type != isc_tokentype_qstring) {
|
||||
token.type != isc_tokentype_qstring)
|
||||
{
|
||||
isc_lex_ungettoken(lexer, &token);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,7 +176,8 @@ generic_totext_key(ARGS_TOTEXT) {
|
|||
|
||||
if ((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0) {
|
||||
if (rdata->type == dns_rdatatype_dnskey ||
|
||||
rdata->type == dns_rdatatype_cdnskey) {
|
||||
rdata->type == dns_rdatatype_cdnskey)
|
||||
{
|
||||
RETERR(str_totext(" ; ", target));
|
||||
RETERR(str_totext(keyinfo, target));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,13 +180,15 @@ get_direction(isc_lex_t *lexer, isc_token_t *token, const char *directions,
|
|||
RETERR(isc_lex_getmastertoken(lexer, token, isc_tokentype_string,
|
||||
false));
|
||||
if (DNS_AS_STR(*token)[0] == directions[1] &&
|
||||
DNS_AS_STR(*token)[1] == 0) {
|
||||
DNS_AS_STR(*token)[1] == 0)
|
||||
{
|
||||
*direction = DNS_AS_STR(*token)[0];
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
if (DNS_AS_STR(*token)[0] == directions[0] &&
|
||||
DNS_AS_STR(*token)[1] == 0) {
|
||||
DNS_AS_STR(*token)[1] == 0)
|
||||
{
|
||||
*direction = DNS_AS_STR(*token)[0];
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
@ -585,7 +587,8 @@ fromwire_loc(ARGS_FROMWIRE) {
|
|||
c = sr.base[1];
|
||||
if (c != 0) {
|
||||
if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 ||
|
||||
((c >> 4) & 0xf) == 0) {
|
||||
((c >> 4) & 0xf) == 0)
|
||||
{
|
||||
return (ISC_R_RANGE);
|
||||
|
||||
/*
|
||||
|
|
@ -600,7 +603,8 @@ fromwire_loc(ARGS_FROMWIRE) {
|
|||
c = sr.base[2];
|
||||
if (c != 0) {
|
||||
if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 ||
|
||||
((c >> 4) & 0xf) == 0) {
|
||||
((c >> 4) & 0xf) == 0)
|
||||
{
|
||||
return (ISC_R_RANGE);
|
||||
|
||||
/*
|
||||
|
|
@ -615,7 +619,8 @@ fromwire_loc(ARGS_FROMWIRE) {
|
|||
c = sr.base[3];
|
||||
if (c != 0) {
|
||||
if ((c & 0xf) > 9 || ((c >> 4) & 0xf) > 9 ||
|
||||
((c >> 4) & 0xf) == 0) {
|
||||
((c >> 4) & 0xf) == 0)
|
||||
{
|
||||
return (ISC_R_RANGE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ fromtext_tkey(ARGS_FROMTEXT) {
|
|||
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
|
||||
false));
|
||||
if (dns_tsigrcode_fromtext(&rcode, &token.value.as_textregion) !=
|
||||
ISC_R_SUCCESS) {
|
||||
ISC_R_SUCCESS)
|
||||
{
|
||||
i = strtol(DNS_AS_STR(token), &e, 10);
|
||||
if (*e != 0) {
|
||||
RETTOK(DNS_R_UNKNOWN);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ generic_fromtext_txt(ARGS_FROMTEXT) {
|
|||
RETERR(isc_lex_getmastertoken(lexer, &token,
|
||||
isc_tokentype_qstring, true));
|
||||
if (token.type != isc_tokentype_qstring &&
|
||||
token.type != isc_tokentype_string) {
|
||||
token.type != isc_tokentype_string)
|
||||
{
|
||||
break;
|
||||
}
|
||||
RETTOK(txt_fromtext(&token.value.as_textregion, target));
|
||||
|
|
|
|||
|
|
@ -227,7 +227,8 @@ checkowner_in_a(ARGS_CHECKOWNER) {
|
|||
dns_name_init(&suffix, NULL);
|
||||
dns_name_split(name, labels - 2, &prefix, &suffix);
|
||||
if (dns_name_equal(&gc_msdcs, &prefix) &&
|
||||
dns_name_ishostname(&suffix, false)) {
|
||||
dns_name_ishostname(&suffix, false))
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,8 @@ checkowner_in_aaaa(ARGS_CHECKOWNER) {
|
|||
dns_name_split(name, dns_name_countlabels(name) - 2, &prefix,
|
||||
&suffix);
|
||||
if (dns_name_equal(&gc_msdcs, &prefix) &&
|
||||
dns_name_ishostname(&suffix, false)) {
|
||||
dns_name_ishostname(&suffix, false))
|
||||
{
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ svcsortkeylist(isc_buffer_t *target, unsigned int used) {
|
|||
/* Reject duplicates. */
|
||||
while (region.length >= 4) {
|
||||
if (region.base[0] == region.base[2] &&
|
||||
region.base[1] == region.base[3]) {
|
||||
region.base[1] == region.base[3])
|
||||
{
|
||||
return (DNS_R_SYNTAX);
|
||||
}
|
||||
isc_region_consume(®ion, 2);
|
||||
|
|
@ -104,13 +105,15 @@ svcb_validate(uint16_t key, isc_region_t *region) {
|
|||
break;
|
||||
case sbpr_ipv4s:
|
||||
if ((region->length % 4) != 0 ||
|
||||
region->length == 0) {
|
||||
region->length == 0)
|
||||
{
|
||||
return (DNS_R_FORMERR);
|
||||
}
|
||||
break;
|
||||
case sbpr_ipv6s:
|
||||
if ((region->length % 16) != 0 ||
|
||||
region->length == 0) {
|
||||
region->length == 0)
|
||||
{
|
||||
return (DNS_R_FORMERR);
|
||||
}
|
||||
break;
|
||||
|
|
@ -129,7 +132,8 @@ svcb_validate(uint16_t key, isc_region_t *region) {
|
|||
}
|
||||
case sbpr_keylist: {
|
||||
if ((region->length % 2) != 0 ||
|
||||
region->length == 0) {
|
||||
region->length == 0)
|
||||
{
|
||||
return (DNS_R_FORMERR);
|
||||
}
|
||||
/* In order? */
|
||||
|
|
@ -164,12 +168,14 @@ svcb_validate(uint16_t key, isc_region_t *region) {
|
|||
}
|
||||
/* MUST be UTF8 */
|
||||
if (!isc_utf8_valid(region->base,
|
||||
region->length)) {
|
||||
region->length))
|
||||
{
|
||||
return (DNS_R_FORMERR);
|
||||
}
|
||||
/* MUST contain "{?dns}" */
|
||||
if (strnstr((char *)region->base, "{?dns}",
|
||||
region->length) == NULL) {
|
||||
region->length) == NULL)
|
||||
{
|
||||
return (DNS_R_FORMERR);
|
||||
}
|
||||
break;
|
||||
|
|
@ -218,7 +224,8 @@ svc_keyfromregion(isc_textregion_t *region, char sep, uint16_t *value,
|
|||
}
|
||||
/* No zero padding. */
|
||||
if (region->length > 1 && *region->base == '0' &&
|
||||
region->base[1] != sep) {
|
||||
region->base[1] != sep)
|
||||
{
|
||||
return (DNS_R_SYNTAX);
|
||||
}
|
||||
ul = strtoul(region->base, &e, 10);
|
||||
|
|
@ -454,7 +461,8 @@ svcsortkeys(isc_buffer_t *target, unsigned int used) {
|
|||
/* Lone mandatory field. */
|
||||
return (DNS_R_DISALLOWED);
|
||||
} else if (key1 == SVCB_NO_DEFAULT_ALPN_KEY &&
|
||||
!have_alpn) {
|
||||
!have_alpn)
|
||||
{
|
||||
/* Missing required ALPN field. */
|
||||
return (DNS_R_DISALLOWED);
|
||||
}
|
||||
|
|
@ -621,7 +629,8 @@ generic_fromtext_in_svcb(ARGS_FROMTEXT) {
|
|||
RETERR(isc_lex_getmastertoken(lexer, &token,
|
||||
isc_tokentype_qvpair, true));
|
||||
if (token.type == isc_tokentype_eol ||
|
||||
token.type == isc_tokentype_eof) {
|
||||
token.type == isc_tokentype_eof)
|
||||
{
|
||||
isc_lex_ungettoken(lexer, &token);
|
||||
return (svcsortkeys(target, used));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,8 @@ isc__rdatalist_addnoqname(dns_rdataset_t *rdataset, const dns_name_t *name) {
|
|||
continue;
|
||||
}
|
||||
if (rdset->type == dns_rdatatype_nsec ||
|
||||
rdset->type == dns_rdatatype_nsec3) {
|
||||
rdset->type == dns_rdatatype_nsec3)
|
||||
{
|
||||
neg = rdset;
|
||||
}
|
||||
}
|
||||
|
|
@ -215,7 +216,8 @@ isc__rdatalist_addnoqname(dns_rdataset_t *rdataset, const dns_name_t *name) {
|
|||
rdset = ISC_LIST_NEXT(rdset, link))
|
||||
{
|
||||
if (rdset->type == dns_rdatatype_rrsig &&
|
||||
rdset->covers == neg->type) {
|
||||
rdset->covers == neg->type)
|
||||
{
|
||||
negsig = rdset;
|
||||
}
|
||||
}
|
||||
|
|
@ -275,7 +277,8 @@ isc__rdatalist_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
|
|||
rdataset = ISC_LIST_NEXT(rdataset, link))
|
||||
{
|
||||
if (rdataset->type == dns_rdatatype_rrsig &&
|
||||
rdataset->covers == tneg->type) {
|
||||
rdataset->covers == tneg->type)
|
||||
{
|
||||
tnegsig = rdataset;
|
||||
}
|
||||
}
|
||||
|
|
@ -305,7 +308,8 @@ isc__rdatalist_addclosest(dns_rdataset_t *rdataset, const dns_name_t *name) {
|
|||
continue;
|
||||
}
|
||||
if (rdset->type == dns_rdatatype_nsec ||
|
||||
rdset->type == dns_rdatatype_nsec3) {
|
||||
rdset->type == dns_rdatatype_nsec3)
|
||||
{
|
||||
neg = rdset;
|
||||
}
|
||||
}
|
||||
|
|
@ -317,7 +321,8 @@ isc__rdatalist_addclosest(dns_rdataset_t *rdataset, const dns_name_t *name) {
|
|||
rdset = ISC_LIST_NEXT(rdset, link))
|
||||
{
|
||||
if (rdset->type == dns_rdatatype_rrsig &&
|
||||
rdset->covers == neg->type) {
|
||||
rdset->covers == neg->type)
|
||||
{
|
||||
negsig = rdset;
|
||||
}
|
||||
}
|
||||
|
|
@ -377,7 +382,8 @@ isc__rdatalist_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
|
|||
rdataset = ISC_LIST_NEXT(rdataset, link))
|
||||
{
|
||||
if (rdataset->type == dns_rdatatype_rrsig &&
|
||||
rdataset->covers == tneg->type) {
|
||||
rdataset->covers == tneg->type)
|
||||
{
|
||||
tnegsig = rdataset;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,7 +413,8 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
|
|||
}
|
||||
|
||||
if (want_cyclic &&
|
||||
(rdataset->count != DNS_RDATASET_COUNT_UNDEFINED)) {
|
||||
(rdataset->count != DNS_RDATASET_COUNT_UNDEFINED))
|
||||
{
|
||||
j = rdataset->count % count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -953,7 +953,8 @@ dns_rdataslab_equal(unsigned char *slab1, unsigned char *slab2,
|
|||
#endif /* if DNS_RDATASET_FIXED */
|
||||
|
||||
if (length1 != length2 ||
|
||||
memcmp(current1, current2, length1) != 0) {
|
||||
memcmp(current1, current2, length1) != 0)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -665,7 +665,8 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
|
|||
}
|
||||
|
||||
if (srcaddr != NULL &&
|
||||
isc_sockaddr_pf(srcaddr) != isc_sockaddr_pf(destaddr)) {
|
||||
isc_sockaddr_pf(srcaddr) != isc_sockaddr_pf(destaddr))
|
||||
{
|
||||
return (ISC_R_FAMILYMISMATCH);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1089,7 +1089,8 @@ fix_mustbedelegationornxdomain(dns_message_t *message, fetchctx_t *fctx) {
|
|||
* RRsig from child?
|
||||
*/
|
||||
if (type == dns_rdatatype_rrsig &&
|
||||
rrsig_fromchildzone(fctx, rdataset)) {
|
||||
rrsig_fromchildzone(fctx, rdataset))
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
/*
|
||||
|
|
@ -1124,7 +1125,8 @@ fix_mustbedelegationornxdomain(dns_message_t *message, fetchctx_t *fctx) {
|
|||
* A NODATA response to a DS query?
|
||||
*/
|
||||
if (fctx->type == dns_rdatatype_ds &&
|
||||
message->counts[DNS_SECTION_ANSWER] == 0) {
|
||||
message->counts[DNS_SECTION_ANSWER] == 0)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
|
||||
|
|
@ -1142,7 +1144,8 @@ fix_mustbedelegationornxdomain(dns_message_t *message, fetchctx_t *fctx) {
|
|||
{
|
||||
type = rdataset->type;
|
||||
if (type == dns_rdatatype_soa &&
|
||||
dns_name_equal(name, domain)) {
|
||||
dns_name_equal(name, domain))
|
||||
{
|
||||
keep_auth = true;
|
||||
}
|
||||
|
||||
|
|
@ -1173,7 +1176,8 @@ fix_mustbedelegationornxdomain(dns_message_t *message, fetchctx_t *fctx) {
|
|||
* case.
|
||||
*/
|
||||
if (message->counts[DNS_SECTION_ANSWER] == 0 &&
|
||||
fctx->type == dns_rdatatype_any) {
|
||||
fctx->type == dns_rdatatype_any)
|
||||
{
|
||||
return (false);
|
||||
}
|
||||
} else if (dns_name_issubdomain(name, domain)) {
|
||||
|
|
@ -1378,7 +1382,8 @@ fctx_cancelquery(resquery_t **queryp, isc_time_t *finish, bool no_response,
|
|||
* context.
|
||||
*/
|
||||
if (fctx->fwdpolicy == dns_fwdpolicy_first &&
|
||||
ISFORWARDER(query->addrinfo)) {
|
||||
ISFORWARDER(query->addrinfo))
|
||||
{
|
||||
add_bad(fctx, query->rmessage, query->addrinfo,
|
||||
ISC_R_TIMEDOUT, badns_forwarder);
|
||||
}
|
||||
|
|
@ -1411,7 +1416,8 @@ fctx_cancelquery(resquery_t **queryp, isc_time_t *finish, bool no_response,
|
|||
* seen a EDNS response.
|
||||
*/
|
||||
if ((query->options & DNS_FETCHOPT_NOEDNS0) == 0 &&
|
||||
!EDNSOK(query->addrinfo)) {
|
||||
!EDNSOK(query->addrinfo))
|
||||
{
|
||||
mask >>= 2;
|
||||
}
|
||||
|
||||
|
|
@ -1522,7 +1528,8 @@ fctx_cleanup(fetchctx_t *fctx) {
|
|||
fctx->find = NULL;
|
||||
|
||||
for (find = ISC_LIST_HEAD(fctx->altfinds); find != NULL;
|
||||
find = next_find) {
|
||||
find = next_find)
|
||||
{
|
||||
next_find = ISC_LIST_NEXT(find, publink);
|
||||
ISC_LIST_UNLINK(fctx->altfinds, find, publink);
|
||||
dns_adb_destroyfind(&find);
|
||||
|
|
@ -1531,14 +1538,16 @@ fctx_cleanup(fetchctx_t *fctx) {
|
|||
fctx->altfind = NULL;
|
||||
|
||||
for (addr = ISC_LIST_HEAD(fctx->forwaddrs); addr != NULL;
|
||||
addr = next_addr) {
|
||||
addr = next_addr)
|
||||
{
|
||||
next_addr = ISC_LIST_NEXT(addr, publink);
|
||||
ISC_LIST_UNLINK(fctx->forwaddrs, addr, publink);
|
||||
dns_adb_freeaddrinfo(fctx->adb, &addr);
|
||||
}
|
||||
|
||||
for (addr = ISC_LIST_HEAD(fctx->altaddrs); addr != NULL;
|
||||
addr = next_addr) {
|
||||
addr = next_addr)
|
||||
{
|
||||
next_addr = ISC_LIST_NEXT(addr, publink);
|
||||
ISC_LIST_UNLINK(fctx->altaddrs, addr, publink);
|
||||
dns_adb_freeaddrinfo(fctx->adb, &addr);
|
||||
|
|
@ -1738,7 +1747,8 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result, int line) {
|
|||
fctx->duration = isc_time_microdiff(&now, &fctx->start);
|
||||
|
||||
for (event = ISC_LIST_HEAD(fctx->events); event != NULL;
|
||||
event = next_event) {
|
||||
event = next_event)
|
||||
{
|
||||
next_event = ISC_LIST_NEXT(event, ev_link);
|
||||
ISC_LIST_UNLINK(fctx->events, event, ev_link);
|
||||
if (event->ev_type == DNS_EVENT_TRYSTALE) {
|
||||
|
|
@ -1768,7 +1778,8 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result, int line) {
|
|||
* Negative results must be indicated in event->result.
|
||||
*/
|
||||
if (dns_rdataset_isassociated(event->rdataset) &&
|
||||
NEGATIVE(event->rdataset)) {
|
||||
NEGATIVE(event->rdataset))
|
||||
{
|
||||
INSIST(event->result == DNS_R_NCACHENXDOMAIN ||
|
||||
event->result == DNS_R_NCACHENXRRSET);
|
||||
}
|
||||
|
|
@ -1783,11 +1794,13 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result, int line) {
|
|||
{
|
||||
LOCK(&fctx->res->lock);
|
||||
if (count == fctx->res->spillat &&
|
||||
!atomic_load_acquire(&fctx->res->exiting)) {
|
||||
!atomic_load_acquire(&fctx->res->exiting))
|
||||
{
|
||||
old_spillat = fctx->res->spillat;
|
||||
fctx->res->spillat += 5;
|
||||
if (fctx->res->spillat > fctx->res->spillatmax &&
|
||||
fctx->res->spillatmax != 0) {
|
||||
fctx->res->spillatmax != 0)
|
||||
{
|
||||
fctx->res->spillat = fctx->res->spillatmax;
|
||||
}
|
||||
new_spillat = fctx->res->spillat;
|
||||
|
|
@ -2548,7 +2561,8 @@ resquery_send(resquery_t *query) {
|
|||
secure_domain = false;
|
||||
}
|
||||
if (secure_domain ||
|
||||
(ISFORWARDER(query->addrinfo) && ntacovered)) {
|
||||
(ISFORWARDER(query->addrinfo) && ntacovered))
|
||||
{
|
||||
fctx->qmessage->flags |= DNS_MESSAGEFLAG_CD;
|
||||
}
|
||||
}
|
||||
|
|
@ -2683,7 +2697,8 @@ resquery_send(resquery_t *query) {
|
|||
result = dns_peer_getednsversion(peer,
|
||||
&ednsversion);
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
ednsversion < version) {
|
||||
ednsversion < version)
|
||||
{
|
||||
version = ednsversion;
|
||||
}
|
||||
}
|
||||
|
|
@ -3097,7 +3112,8 @@ bad_server(fetchctx_t *fctx, isc_sockaddr_t *address) {
|
|||
isc_sockaddr_t *sa;
|
||||
|
||||
for (sa = ISC_LIST_HEAD(fctx->bad); sa != NULL;
|
||||
sa = ISC_LIST_NEXT(sa, link)) {
|
||||
sa = ISC_LIST_NEXT(sa, link))
|
||||
{
|
||||
if (isc_sockaddr_equal(sa, address)) {
|
||||
return (true);
|
||||
}
|
||||
|
|
@ -3630,7 +3646,8 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) {
|
|||
* Strip label to get the correct forwarder (if any).
|
||||
*/
|
||||
if (dns_rdatatype_atparent(fctx->type) &&
|
||||
dns_name_countlabels(name) > 1) {
|
||||
dns_name_countlabels(name) > 1)
|
||||
{
|
||||
dns_name_init(&suffix, NULL);
|
||||
labels = dns_name_countlabels(name);
|
||||
dns_name_getlabelsequence(name, 1, labels - 1, &suffix);
|
||||
|
|
@ -3777,7 +3794,8 @@ normal_nses:
|
|||
alternate_t *a;
|
||||
family = (res->dispatches6 != NULL) ? AF_INET6 : AF_INET;
|
||||
for (a = ISC_LIST_HEAD(res->alternates); a != NULL;
|
||||
a = ISC_LIST_NEXT(a, link)) {
|
||||
a = ISC_LIST_NEXT(a, link))
|
||||
{
|
||||
if (!a->isaddress) {
|
||||
findname(fctx, &a->_u._n.name, a->_u._n.port,
|
||||
stdoptions, FCTX_ADDRINFO_DUALSTACK,
|
||||
|
|
@ -3906,7 +3924,8 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr) {
|
|||
}
|
||||
|
||||
if (peer != NULL && dns_peer_getbogus(peer, &bogus) == ISC_R_SUCCESS &&
|
||||
bogus) {
|
||||
bogus)
|
||||
{
|
||||
aborted = true;
|
||||
}
|
||||
|
||||
|
|
@ -4164,7 +4183,8 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) {
|
|||
addrinfo = fctx_nextaddress(fctx);
|
||||
|
||||
while (addrinfo != NULL &&
|
||||
dns_adbentry_overquota(addrinfo->entry)) {
|
||||
dns_adbentry_overquota(addrinfo->entry))
|
||||
{
|
||||
addrinfo = fctx_nextaddress(fctx);
|
||||
}
|
||||
|
||||
|
|
@ -4442,7 +4462,8 @@ fctx_destroy(fetchctx_t *fctx, bool exiting) {
|
|||
UNLOCK(&res->buckets[bucketnum].lock);
|
||||
|
||||
if (bucket_empty && exiting &&
|
||||
isc_refcount_decrement(&res->activebuckets) == 1) {
|
||||
isc_refcount_decrement(&res->activebuckets) == 1)
|
||||
{
|
||||
LOCK(&res->lock);
|
||||
send_shutdown_events(res);
|
||||
UNLOCK(&res->lock);
|
||||
|
|
@ -4854,7 +4875,8 @@ fctx_create(dns_resolver_t *res, isc_task_t *task, const dns_name_t *name,
|
|||
* the forwarder).
|
||||
*/
|
||||
if (dns_rdatatype_atparent(fctx->type) &&
|
||||
dns_name_countlabels(name) > 1) {
|
||||
dns_name_countlabels(name) > 1)
|
||||
{
|
||||
dns_name_init(&suffix, NULL);
|
||||
labels = dns_name_countlabels(name);
|
||||
dns_name_getlabelsequence(name, 1, labels - 1, &suffix);
|
||||
|
|
@ -5432,7 +5454,8 @@ has_000_label(dns_rdataset_t *nsecset) {
|
|||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
dns_rdataset_current(&rdataset, &rdata);
|
||||
if (rdata.length > 1 && rdata.data[0] == 1 &&
|
||||
rdata.data[1] == 0) {
|
||||
rdata.data[1] == 0)
|
||||
{
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
return (true);
|
||||
}
|
||||
|
|
@ -5588,7 +5611,8 @@ validated(isc_task_t *task, isc_event_t *event) {
|
|||
0);
|
||||
}
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
vevent->sigrdataset != NULL) {
|
||||
vevent->sigrdataset != NULL)
|
||||
{
|
||||
(void)dns_db_deleterdataset(
|
||||
fctx->cache, node, NULL,
|
||||
dns_rdatatype_rrsig, vevent->type);
|
||||
|
|
@ -5613,7 +5637,8 @@ validated(isc_task_t *task, isc_event_t *event) {
|
|||
vevent->rdataset, 0, NULL);
|
||||
}
|
||||
if (result == ISC_R_SUCCESS &&
|
||||
vevent->sigrdataset != NULL) {
|
||||
vevent->sigrdataset != NULL)
|
||||
{
|
||||
(void)dns_db_addrdataset(
|
||||
fctx->cache, node, NULL, now,
|
||||
vevent->sigrdataset, 0, NULL);
|
||||
|
|
@ -5674,7 +5699,8 @@ validated(isc_task_t *task, isc_event_t *event) {
|
|||
* Cache DS NXDOMAIN separately to other types.
|
||||
*/
|
||||
if (message->rcode == dns_rcode_nxdomain &&
|
||||
fctx->type != dns_rdatatype_ds) {
|
||||
fctx->type != dns_rdatatype_ds)
|
||||
{
|
||||
covers = dns_rdatatype_any;
|
||||
} else {
|
||||
covers = fctx->type;
|
||||
|
|
@ -5836,7 +5862,8 @@ answer_response:
|
|||
break;
|
||||
}
|
||||
if (sigrdataset == NULL ||
|
||||
sigrdataset->trust != dns_trust_secure) {
|
||||
sigrdataset->trust != dns_trust_secure)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -5864,7 +5891,8 @@ answer_response:
|
|||
* Check SOA and DNSKEY consistency.
|
||||
*/
|
||||
if (rdataset->type == dns_rdatatype_nsec &&
|
||||
!check_soa_and_dnskey(rdataset)) {
|
||||
!check_soa_and_dnskey(rdataset))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -5872,7 +5900,8 @@ answer_response:
|
|||
* Look for \000 label in next name.
|
||||
*/
|
||||
if (rdataset->type == dns_rdatatype_nsec &&
|
||||
has_000_label(rdataset)) {
|
||||
has_000_label(rdataset))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -5940,7 +5969,8 @@ answer_response:
|
|||
*/
|
||||
INSIST(hevent->rdataset != NULL);
|
||||
if (dns_rdataset_isassociated(hevent->rdataset) &&
|
||||
NEGATIVE(hevent->rdataset)) {
|
||||
NEGATIVE(hevent->rdataset))
|
||||
{
|
||||
INSIST(eresult == DNS_R_NCACHENXDOMAIN ||
|
||||
eresult == DNS_R_NCACHENXRRSET);
|
||||
}
|
||||
|
|
@ -6011,7 +6041,8 @@ findnoqname(fetchctx_t *fctx, dns_message_t *message, dns_name_t *name,
|
|||
sigrdataset = ISC_LIST_NEXT(sigrdataset, link))
|
||||
{
|
||||
if (sigrdataset->type == dns_rdatatype_rrsig &&
|
||||
sigrdataset->covers == type) {
|
||||
sigrdataset->covers == type)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -6057,7 +6088,8 @@ findnoqname(fetchctx_t *fctx, dns_message_t *message, dns_name_t *name,
|
|||
dns_name_t *nsec = NULL;
|
||||
dns_message_currentname(message, section, &nsec);
|
||||
for (nrdataset = ISC_LIST_HEAD(nsec->list); nrdataset != NULL;
|
||||
nrdataset = next) {
|
||||
nrdataset = next)
|
||||
{
|
||||
bool data = false, exists = false;
|
||||
bool optout = false, unknown = false;
|
||||
bool setclosest = false;
|
||||
|
|
@ -6104,7 +6136,8 @@ findnoqname(fetchctx_t *fctx, dns_message_t *message, dns_name_t *name,
|
|||
sigrdataset = ISC_LIST_NEXT(sigrdataset, link))
|
||||
{
|
||||
if (sigrdataset->type == dns_rdatatype_rrsig &&
|
||||
sigrdataset->covers == found) {
|
||||
sigrdataset->covers == found)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -6170,7 +6203,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
}
|
||||
|
||||
if (((name->attributes & DNS_NAMEATTR_ANSWER) != 0) &&
|
||||
(!need_validation)) {
|
||||
(!need_validation))
|
||||
{
|
||||
have_answer = true;
|
||||
event = ISC_LIST_HEAD(fctx->events);
|
||||
|
||||
|
|
@ -6287,7 +6321,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
* query to the domain that owns them.)
|
||||
*/
|
||||
if (secure_domain && rdataset->trust != dns_trust_glue &&
|
||||
!EXTERNAL(rdataset)) {
|
||||
!EXTERNAL(rdataset))
|
||||
{
|
||||
dns_trust_t trust;
|
||||
|
||||
/*
|
||||
|
|
@ -6299,7 +6334,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
}
|
||||
|
||||
if (sigrdataset == NULL && need_validation &&
|
||||
!ANSWER(rdataset)) {
|
||||
!ANSWER(rdataset))
|
||||
{
|
||||
/*
|
||||
* Ignore unrelated non-answer
|
||||
* rdatasets that are missing
|
||||
|
|
@ -6345,24 +6381,28 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
if (!need_validation || !ANSWER(rdataset)) {
|
||||
options = 0;
|
||||
if (ANSWER(rdataset) &&
|
||||
rdataset->type != dns_rdatatype_rrsig) {
|
||||
rdataset->type != dns_rdatatype_rrsig)
|
||||
{
|
||||
isc_result_t tresult;
|
||||
dns_name_t *noqname = NULL;
|
||||
tresult = findnoqname(
|
||||
fctx, message, name,
|
||||
rdataset->type, &noqname);
|
||||
if (tresult == ISC_R_SUCCESS &&
|
||||
noqname != NULL) {
|
||||
noqname != NULL)
|
||||
{
|
||||
(void)dns_rdataset_addnoqname(
|
||||
rdataset, noqname);
|
||||
}
|
||||
}
|
||||
if ((fctx->options & DNS_FETCHOPT_PREFETCH) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
options = DNS_DBADD_PREFETCH;
|
||||
}
|
||||
if ((fctx->options & DNS_FETCHOPT_NOCACHED) !=
|
||||
0) {
|
||||
0)
|
||||
{
|
||||
options |= DNS_DBADD_FORCE;
|
||||
}
|
||||
addedrdataset = ardataset;
|
||||
|
|
@ -6373,7 +6413,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
result = ISC_R_SUCCESS;
|
||||
if (!need_validation &&
|
||||
ardataset != NULL &&
|
||||
NEGATIVE(ardataset)) {
|
||||
NEGATIVE(ardataset))
|
||||
{
|
||||
/*
|
||||
* The answer in the
|
||||
* cache is better than
|
||||
|
|
@ -6503,7 +6544,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
}
|
||||
|
||||
if (ANSWER(rdataset) &&
|
||||
rdataset->type != dns_rdatatype_rrsig) {
|
||||
rdataset->type != dns_rdatatype_rrsig)
|
||||
{
|
||||
isc_result_t tresult;
|
||||
dns_name_t *noqname = NULL;
|
||||
tresult = findnoqname(fctx, message, name,
|
||||
|
|
@ -6524,7 +6566,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
|
||||
if (result == DNS_R_UNCHANGED) {
|
||||
if (ANSWER(rdataset) && ardataset != NULL &&
|
||||
NEGATIVE(ardataset)) {
|
||||
NEGATIVE(ardataset))
|
||||
{
|
||||
/*
|
||||
* The answer in the cache is
|
||||
* better than the answer we
|
||||
|
|
@ -6568,7 +6611,8 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||
* event->result.
|
||||
*/
|
||||
if (dns_rdataset_isassociated(event->rdataset) &&
|
||||
NEGATIVE(event->rdataset)) {
|
||||
NEGATIVE(event->rdataset))
|
||||
{
|
||||
INSIST(eresult == DNS_R_NCACHENXDOMAIN ||
|
||||
eresult == DNS_R_NCACHENXRRSET);
|
||||
}
|
||||
|
|
@ -6606,7 +6650,8 @@ cache_message(fetchctx_t *fctx, dns_message_t *message,
|
|||
LOCK(&fctx->res->buckets[fctx->bucketnum].lock);
|
||||
|
||||
for (section = DNS_SECTION_ANSWER; section <= DNS_SECTION_ADDITIONAL;
|
||||
section++) {
|
||||
section++)
|
||||
{
|
||||
result = dns_message_firstname(message, section);
|
||||
while (result == ISC_R_SUCCESS) {
|
||||
name = NULL;
|
||||
|
|
@ -7019,7 +7064,8 @@ check_section(void *arg, const dns_name_t *addname, dns_rdatatype_t type,
|
|||
rtype = rdataset->type;
|
||||
}
|
||||
if (rtype == dns_rdatatype_a ||
|
||||
rtype == dns_rdatatype_aaaa) {
|
||||
rtype == dns_rdatatype_aaaa)
|
||||
{
|
||||
mark_related(name, rdataset, external,
|
||||
gluing);
|
||||
}
|
||||
|
|
@ -7475,7 +7521,8 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
|
|||
*/
|
||||
dns_rdataset_init(&nameservers);
|
||||
if (dns_rdataset_isassociated(
|
||||
&fctx->nsfetch->private->nameservers)) {
|
||||
&fctx->nsfetch->private->nameservers))
|
||||
{
|
||||
dns_rdataset_clone(&fctx->nsfetch->private->nameservers,
|
||||
&nameservers);
|
||||
nsrdataset = &nameservers;
|
||||
|
|
@ -7814,7 +7861,8 @@ resquery_response(isc_result_t eresult, isc_region_t *region, void *arg) {
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
FCTXTRACE3("signature check failed", result);
|
||||
if (result == DNS_R_UNEXPECTEDTSIG ||
|
||||
result == DNS_R_EXPECTEDTSIG) {
|
||||
result == DNS_R_EXPECTEDTSIG)
|
||||
{
|
||||
rctx.nextitem = true;
|
||||
}
|
||||
rctx_done(&rctx, result);
|
||||
|
|
@ -8086,7 +8134,8 @@ rctx_answer_init(respctx_t *rctx) {
|
|||
*/
|
||||
rctx->type = fctx->type;
|
||||
if (rctx->type == dns_rdatatype_rrsig ||
|
||||
rctx->type == dns_rdatatype_sig) {
|
||||
rctx->type == dns_rdatatype_sig)
|
||||
{
|
||||
rctx->type = dns_rdatatype_any;
|
||||
}
|
||||
|
||||
|
|
@ -8668,7 +8717,8 @@ rctx_answer_scan(respctx_t *rctx) {
|
|||
rdataset = ISC_LIST_NEXT(rdataset, link))
|
||||
{
|
||||
if (rdataset->type == rctx->type ||
|
||||
rctx->type == dns_rdatatype_any) {
|
||||
rctx->type == dns_rdatatype_any)
|
||||
{
|
||||
rctx->aname = name;
|
||||
if (rctx->type != dns_rdatatype_any) {
|
||||
rctx->ardataset = rdataset;
|
||||
|
|
@ -8698,7 +8748,8 @@ rctx_answer_scan(respctx_t *rctx) {
|
|||
* and any previously found dname.
|
||||
*/
|
||||
if (nlabels >= rctx->dname_labels ||
|
||||
nlabels < rctx->domain_labels) {
|
||||
nlabels < rctx->domain_labels)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -9273,7 +9324,8 @@ rctx_authority_negative(respctx_t *rctx) {
|
|||
*/
|
||||
if (rdataset->type == dns_rdatatype_ns) {
|
||||
if (rctx->ns_name != NULL &&
|
||||
name != rctx->ns_name) {
|
||||
name != rctx->ns_name)
|
||||
{
|
||||
log_formerr(fctx, "multiple NS "
|
||||
"RRsets "
|
||||
"in "
|
||||
|
|
@ -9297,7 +9349,8 @@ rctx_authority_negative(respctx_t *rctx) {
|
|||
*/
|
||||
if (rdataset->type == dns_rdatatype_soa) {
|
||||
if (rctx->soa_name != NULL &&
|
||||
name != rctx->soa_name) {
|
||||
name != rctx->soa_name)
|
||||
{
|
||||
log_formerr(fctx, "multiple "
|
||||
"SOA RRs "
|
||||
"in "
|
||||
|
|
@ -9460,7 +9513,8 @@ rctx_authority_dnssec(respctx_t *rctx) {
|
|||
|
||||
if (rdataset->type == dns_rdatatype_ds) {
|
||||
if (rctx->ds_name != NULL &&
|
||||
name != rctx->ds_name) {
|
||||
name != rctx->ds_name)
|
||||
{
|
||||
log_formerr(fctx, "DS doesn't "
|
||||
"match "
|
||||
"referral "
|
||||
|
|
@ -10042,7 +10096,8 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) {
|
|||
* Record that we got a good EDNS response.
|
||||
*/
|
||||
if (query->ednsversion > (int)version &&
|
||||
!EDNSOK(query->addrinfo)) {
|
||||
!EDNSOK(query->addrinfo))
|
||||
{
|
||||
dns_adb_changeflags(fctx->adb, query->addrinfo,
|
||||
FCTX_ADDRINFO_EDNSOK,
|
||||
FCTX_ADDRINFO_EDNSOK);
|
||||
|
|
@ -10620,7 +10675,8 @@ dns_resolver_shutdown(dns_resolver_t *res) {
|
|||
atomic_store(&res->buckets[i].exiting, true);
|
||||
if (ISC_LIST_EMPTY(res->buckets[i].fctxs)) {
|
||||
if (isc_refcount_decrement(
|
||||
&res->activebuckets) == 1) {
|
||||
&res->activebuckets) == 1)
|
||||
{
|
||||
is_done = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -10963,7 +11019,8 @@ dns_resolver_cancelfetch(dns_fetch_t *fetch) {
|
|||
if (fctx->state != fetchstate_done) {
|
||||
dns_fetchevent_t *next_event = NULL;
|
||||
for (event = ISC_LIST_HEAD(fctx->events); event != NULL;
|
||||
event = next_event) {
|
||||
event = next_event)
|
||||
{
|
||||
next_event = ISC_LIST_NEXT(event, ev_link);
|
||||
if (event->fetch == fetch) {
|
||||
ISC_LIST_UNLINK(fctx->events, event, ev_link);
|
||||
|
|
@ -11014,7 +11071,8 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp) {
|
|||
if (fctx->state != fetchstate_done) {
|
||||
dns_fetchevent_t *event = NULL, *next_event = NULL;
|
||||
for (event = ISC_LIST_HEAD(fctx->events); event != NULL;
|
||||
event = next_event) {
|
||||
event = next_event)
|
||||
{
|
||||
next_event = ISC_LIST_NEXT(event, ev_link);
|
||||
RUNTIME_CHECK(event->fetch != fetch);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -293,7 +293,8 @@ report(dns_view_t *view, dns_name_t *name, bool missing, dns_rdata_t *rdata) {
|
|||
isc_result_t result;
|
||||
|
||||
if (strcmp(view->name, "_bind") != 0 &&
|
||||
strcmp(view->name, "_default") != 0) {
|
||||
strcmp(view->name, "_default") != 0)
|
||||
{
|
||||
viewname = view->name;
|
||||
sep = ": view ";
|
||||
}
|
||||
|
|
@ -470,7 +471,8 @@ dns_root_checkhints(dns_view_t *view, dns_db_t *hints, dns_db_t *db) {
|
|||
isc_stdtime_get(&now);
|
||||
|
||||
if (strcmp(view->name, "_bind") != 0 &&
|
||||
strcmp(view->name, "_default") != 0) {
|
||||
strcmp(view->name, "_default") != 0)
|
||||
{
|
||||
viewname = view->name;
|
||||
sep = ": view ";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -907,9 +907,11 @@ name2ipkey(int log_level, const dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
|
|||
*/
|
||||
*tgt_prefix = (dns_rpz_prefix_t)prefix_num;
|
||||
for (i = 0; ip_labels > 0 && i < DNS_RPZ_CIDR_WORDS * 2;
|
||||
ip_labels--) {
|
||||
ip_labels--)
|
||||
{
|
||||
if (cp[0] == 'z' && cp[1] == 'z' &&
|
||||
(cp[2] == '.' || cp[2] == '\0') && i <= 6) {
|
||||
(cp[2] == '.' || cp[2] == '\0') && i <= 6)
|
||||
{
|
||||
do {
|
||||
if ((i & 1) == 0) {
|
||||
tgt_ip->w[3 - i / 2] = 0;
|
||||
|
|
@ -920,7 +922,8 @@ name2ipkey(int log_level, const dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
|
|||
} else {
|
||||
l = strtoul(cp, &cp2, 16);
|
||||
if (l > 0xffffu ||
|
||||
(*cp2 != '.' && *cp2 != '\0')) {
|
||||
(*cp2 != '.' && *cp2 != '\0'))
|
||||
{
|
||||
if (*cp2 == '.') {
|
||||
*cp2 = '\0';
|
||||
}
|
||||
|
|
@ -965,7 +968,8 @@ name2ipkey(int log_level, const dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
|
|||
* Complain about bad names but be generous and accept them.
|
||||
*/
|
||||
if (log_level < DNS_RPZ_DEBUG_QUIET &&
|
||||
isc_log_wouldlog(dns_lctx, log_level)) {
|
||||
isc_log_wouldlog(dns_lctx, log_level))
|
||||
{
|
||||
/*
|
||||
* Convert the address back to a canonical domain name
|
||||
* to ensure that the original name is in canonical form.
|
||||
|
|
@ -974,7 +978,8 @@ name2ipkey(int log_level, const dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num,
|
|||
result = ip2name(tgt_ip, (dns_rpz_prefix_t)prefix_num, NULL,
|
||||
ip_name2);
|
||||
if (result != ISC_R_SUCCESS ||
|
||||
!dns_name_equal(&ip_name, ip_name2)) {
|
||||
!dns_name_equal(&ip_name, ip_name2))
|
||||
{
|
||||
dns_name_format(ip_name2, ip2_str, sizeof(ip2_str));
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ,
|
||||
DNS_LOGMODULE_RBTDB, log_level,
|
||||
|
|
@ -1703,7 +1708,8 @@ setup_update(dns_rpz_zone_t *rpz) {
|
|||
nodecount = dns_db_nodecount(rpz->updb, dns_dbtree_main);
|
||||
hashsize = 1;
|
||||
while (nodecount != 0 &&
|
||||
hashsize <= (DNS_RPZ_HTSIZE_MAX + DNS_RPZ_HTSIZE_DIV)) {
|
||||
hashsize <= (DNS_RPZ_HTSIZE_MAX + DNS_RPZ_HTSIZE_DIV))
|
||||
{
|
||||
hashsize++;
|
||||
nodecount >>= 1;
|
||||
}
|
||||
|
|
@ -2256,7 +2262,8 @@ dns_rpz_detach_rpzs(dns_rpz_zones_t **rpzsp) {
|
|||
* the last reference.
|
||||
*/
|
||||
for (dns_rpz_num_t rpz_num = 0; rpz_num < DNS_RPZ_MAX_ZONES;
|
||||
++rpz_num) {
|
||||
++rpz_num)
|
||||
{
|
||||
dns_rpz_zone_t *rpz = rpzs->zones[rpz_num];
|
||||
rpzs->zones[rpz_num] = NULL;
|
||||
if (rpz != NULL) {
|
||||
|
|
@ -2422,7 +2429,8 @@ del_cidr(dns_rpz_zones_t *rpzs, dns_rpz_num_t rpz_num, dns_rpz_type_t rpz_type,
|
|||
child = tgt->child[1];
|
||||
}
|
||||
if (tgt->set.client_ip != 0 || tgt->set.ip != 0 ||
|
||||
tgt->set.nsip != 0) {
|
||||
tgt->set.nsip != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,7 +234,8 @@ expand_entries(dns_rrl_t *rrl, int newsize) {
|
|||
int i;
|
||||
|
||||
if (rrl->num_entries + newsize >= rrl->max_entries &&
|
||||
rrl->max_entries != 0) {
|
||||
rrl->max_entries != 0)
|
||||
{
|
||||
newsize = rrl->max_entries - rrl->num_entries;
|
||||
if (newsize <= 0) {
|
||||
return (ISC_R_SUCCESS);
|
||||
|
|
@ -374,7 +375,8 @@ ref_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, int probes, isc_stdtime_t now) {
|
|||
rrl->probes += probes;
|
||||
++rrl->searches;
|
||||
if (rrl->searches > 100 &&
|
||||
delta_rrl_time(rrl->hash->check_time, now) > 1) {
|
||||
delta_rrl_time(rrl->hash->check_time, now) > 1)
|
||||
{
|
||||
if (rrl->probes / rrl->searches > 2) {
|
||||
expand_rrl_hash(rrl, now);
|
||||
}
|
||||
|
|
@ -427,7 +429,8 @@ make_key(const dns_rrl_t *rrl, dns_rrl_key_t *key,
|
|||
key->s.qtype = qtype;
|
||||
key->s.qclass = qclass & 0xff;
|
||||
} else if (rtype == DNS_RRL_RTYPE_REFERRAL ||
|
||||
rtype == DNS_RRL_RTYPE_NODATA) {
|
||||
rtype == DNS_RRL_RTYPE_NODATA)
|
||||
{
|
||||
/*
|
||||
* Because there is no qtype in the empty answer sections of
|
||||
* referral and NODATA responses, count them as the same.
|
||||
|
|
@ -927,7 +930,8 @@ make_log_buf(dns_rrl_t *rrl, dns_rrl_entry_t *e, const char *str1,
|
|||
{
|
||||
qbuf = get_qname(rrl, e);
|
||||
if (save_qname && qbuf == NULL && qname != NULL &&
|
||||
dns_name_isabsolute(qname)) {
|
||||
dns_name_isabsolute(qname))
|
||||
{
|
||||
/*
|
||||
* Capture the qname for the "stop limiting" message.
|
||||
*/
|
||||
|
|
@ -1013,7 +1017,8 @@ log_stops(dns_rrl_t *rrl, isc_stdtime_t now, int limit, char *log_buf,
|
|||
if (now != 0) {
|
||||
age = get_age(rrl, e, now);
|
||||
if (age < DNS_RRL_STOP_LOG_SECS ||
|
||||
response_balance(rrl, e, age) < 0) {
|
||||
response_balance(rrl, e, age) < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1085,7 +1090,8 @@ dns_rrl(dns_view_t *view, dns_zone_t *zone, const isc_sockaddr_t *client_addr,
|
|||
qps = (1.0 * rrl->qps_responses) / secs;
|
||||
if (secs >= rrl->window) {
|
||||
if (isc_log_wouldlog(dns_lctx,
|
||||
DNS_RRL_LOG_DEBUG3)) {
|
||||
DNS_RRL_LOG_DEBUG3))
|
||||
{
|
||||
isc_log_write(dns_lctx,
|
||||
DNS_LOGCATEGORY_RRL,
|
||||
DNS_LOGMODULE_REQUEST,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue