zone.c revision fd0d60b3a0139c040fedb0bb765fd9667831412e
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User * Copyright (C) 1999-2017 Internet Systems Consortium, Inc. ("ISC")
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * This Source Code Form is subject to the terms of the Mozilla Public
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * License, v. 2.0. If a copy of the MPL was not distributed with this
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * file, You can obtain one at http://mozilla.org/MPL/2.0/.
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt#define DNS_ZONE_VALID(zone) ISC_MAGIC_VALID(zone, ZONE_MAGIC)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define DNS_NOTIFY_VALID(notify) ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt#define DNS_STUB_VALID(stub) ISC_MAGIC_VALID(stub, STUB_MAGIC)
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt#define ZONEMGR_MAGIC ISC_MAGIC('Z', 'm', 'g', 'r')
e9a9bb6b14df7dd5f86ea869e51a03387b64e0e2Evan Hunt#define DNS_ZONEMGR_VALID(stub) ISC_MAGIC_VALID(stub, ZONEMGR_MAGIC)
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt#define DNS_LOAD_VALID(load) ISC_MAGIC_VALID(load, LOAD_MAGIC)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define FORWARD_MAGIC ISC_MAGIC('F', 'o', 'r', 'w')
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define DNS_FORWARD_VALID(load) ISC_MAGIC_VALID(load, FORWARD_MAGIC)
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt#define DNS_IO_VALID(load) ISC_MAGIC_VALID(load, IO_MAGIC)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * Ensure 'a' is at least 'min' but not more than 'max'.
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt (((a) < (min)) ? (min) : ((a) < (max) ? (a) : (max)))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#define NSEC3REMOVE(x) (((x) & DNS_NSEC3FLAG_REMOVE) != 0)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define REVOKE(x) ((dst_key_flags(x) & DNS_KEYFLAG_REVOKE) != 0)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define KSK(x) ((dst_key_flags(x) & DNS_KEYFLAG_KSK) != 0)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * Default values.
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt#define MAX_XFER_TIME (2*3600) /*%< Documented default is 2 hours */
45d4d69a8d662b6a00e3723c5488af40174a63cbTatuya JINMEI 神明達哉typedef ISC_LIST(dns_signing_t) dns_signinglist_t;
6493425eaa8d09485bcbf78e4f854b1a35ef71edTatuya JINMEI 神明達哉typedef struct dns_nsec3chain dns_nsec3chain_t;
45d4d69a8d662b6a00e3723c5488af40174a63cbTatuya JINMEI 神明達哉typedef ISC_LIST(dns_nsec3chain_t) dns_nsec3chainlist_t;
45d4d69a8d662b6a00e3723c5488af40174a63cbTatuya JINMEI 神明達哉typedef struct dns_keyfetch dns_keyfetch_t;
45d4d69a8d662b6a00e3723c5488af40174a63cbTatuya JINMEI 神明達哉typedef struct dns_asyncload dns_asyncload_t;
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt do { (z)->locked = ISC_FALSE; UNLOCK(&(z)->lock); } while (0)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt do { result = isc_mutex_trylock(&(z)->lock); } while (0)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define ZONEDB_INITLOCK(l) isc_rwlock_init((l), 0, 0)
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt#define ZONEDB_DESTROYLOCK(l) isc_rwlock_destroy(l)
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt /* Unlocked */
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt unsigned int magic;
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt /* Locked */
46bc64f4b1a0e84ab0397943453fe83a17baf2c4Evan Hunt ISC_LIST(dns_include_t) includes; /* Include files */
6493425eaa8d09485bcbf78e4f854b1a35ef71edTatuya JINMEI 神明達哉 ISC_LIST(dns_include_t) newincludes; /* Loading */
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt unsigned int nincludes;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt unsigned int flags;
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt unsigned int options;
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt unsigned int options2;
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt unsigned int db_argc;
char *keydirectory;
unsigned int masterscnt;
unsigned int curmaster;
unsigned int notifycnt;
void *isselfarg;
char * strnamerd;
char * strname;
char * strrdclass;
char * strviewname;
* Autosigning/key-maintenance options
} zonediff_t;
#define zonediff_init(z, d) \
#define DNS_ZONE_SETFLAG(z,f) do { \
(z)->flags |= (f); \
#define DNS_ZONE_CLRFLAG(z,f) do { \
(z)->flags &= ~(f); \
/* XXX MPA these may need to go back into zone.h */
struct dns_unreachable {
struct dns_zonemgr {
unsigned int magic;
unsigned int notifyrate;
unsigned int startupnotifyrate;
unsigned int serialqueryrate;
unsigned int startupserialqueryrate;
struct dns_notify {
unsigned int magic;
unsigned int flags;
struct dns_stub {
unsigned int magic;
struct dns_load {
unsigned int magic;
struct dns_forward {
unsigned int magic;
void *callback_arg;
unsigned int options;
struct dns_io {
unsigned int magic;
struct dns_signing {
unsigned int magic;
struct dns_nsec3chain {
unsigned int magic;
* 'salt' is buffer space and is referenced via 'nsec3param.salt'.
struct dns_keyfetch {
struct dns_asyncload {
void *loaded_arg;
struct dns_include {
char *name;
unsigned int flags,
static isc_result_t
unsigned int *errors);
const char *templat);
unsigned int value);
#define DNS_ZONE_JITTER_ADD(a, b, c) \
#define DNS_ZONE_TIME_ADD(a, b, c) \
struct nsec3param {
unsigned int length;
struct np3event {
struct ssevent {
return (ISC_R_NOMEMORY);
goto free_zone;
goto free_mutex;
#ifdef DNS_ZONE_CHECKLOCK
goto free_dblock;
goto free_erefs;
return (ISC_R_SUCCESS);
return (result);
dns_include_t *include;
include != NULL;
include != NULL;
== ISC_R_SUCCESS);
== ISC_R_SUCCESS);
static inline isc_boolean_t
return (ISC_TRUE);
return (ISC_FALSE);
static inline isc_boolean_t
return (ISC_TRUE);
return (ISC_FALSE);
unsigned int soacount;
NULL);
return (result);
return (serial);
void *mem;
return (result);
goto nomem;
for (i = 0; i < dbargc; i++)
for (i = 0; i < dbargc; i++) {
goto nomem;
goto unlock;
for (i = 0; i < dbargc; i++)
return (result);
return (result);
static isc_result_t
char *copy;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (result);
if (maxttl != 0)
static isc_result_t
char *journal;
return (ISC_R_NOMEMORY);
return (result);
return (result);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_R_NOTIMPLEMENTED);
return (ISC_R_NOTIMPLEMENTED);
return (ISC_R_SUCCESS);
static isc_boolean_t
dns_include_t *include;
return (ISC_TRUE);
include != NULL;
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
if (!locked)
if (hasraw) {
if (!locked)
return(result);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
rbt) {
goto cleanup;
&db);
goto cleanup;
goto cleanup;
goto cleanup;
if (hasraw)
if (!locked)
return (result);
goto cleanup;
if (!load_pending) {
goto cleanup;
isc_event_t *e;
return (ISC_R_FAILURE);
return (ISC_R_ALREADYRUNNING);
sizeof(isc_event_t));
if (e == NULL)
return (ISC_R_SUCCESS);
return (result);
switch (result) {
case DNS_R_CONTINUE:
case DNS_R_UPTODATE:
case ISC_R_SUCCESS:
case DNS_R_SEENINCLUDE:
case DNS_R_NOMASTERFILE:
return (result);
unsigned int options;
return (options);
unsigned int options;
goto fail;
goto fail;
fail:
unsigned int soacount;
NULL);
goto fail;
&rawdata);
goto fail;
fail:
static isc_result_t
unsigned int options;
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
return (result);
return (result);
return (result);
static isc_boolean_t
int level;
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
altbuf);
return (ISC_TRUE);
static isc_boolean_t
int level;
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
altbuf);
return (ISC_TRUE);
static isc_boolean_t
int level;
return (ISC_TRUE);
dns_rdataset_init(&a);
switch (result) {
case ISC_R_SUCCESS:
case DNS_R_DNAME:
case DNS_R_CNAME:
if (dns_rdataset_isassociated(&a))
return (ISC_TRUE);
if (dns_rdataset_isassociated(&a))
return (ISC_TRUE);
&a, &aaaa);
if (dns_rdataset_isassociated(&a))
return (answer);
const char *what;
&a, &aaaa);
if (dns_rdataset_isassociated(&a))
return (answer);
static isc_boolean_t
unsigned int count1 = 0;
unsigned int count2 = 0;
count1++;
count2++;
if (format) {
sizeof ownerbuf);
sizeof(typebuf));
if (!format)
return (answer);
static isc_boolean_t
return (ISC_TRUE);
return (ok);
static isc_boolean_t
while (rdl > 0U) {
++data;
--rdl;
i += len;
return(ISC_FALSE);
buf[i] = 0;
return (ISC_TRUE);
return (ISC_FALSE);
static isc_boolean_t
return (ISC_TRUE);
goto cleanup;
goto next;
goto checkmx;
goto checkmx;
goto next;
goto checksrv;
goto next;
goto checkspf;
goto next;
goto next;
goto notxt;
if (have_txt)
next:
return (ok);
const char *algorithm;
goto cleanup;
goto cleanup;
if (logit)
goto cleanup;
goto cleanup;
goto cleanup;
static isc_result_t
unsigned int options = 0;
goto cleanup;
goto cleanup;
goto cleanup;
saltbuf);
return (result);
goto cleanup;
goto cleanup;
goto cleanup;
sizeof(buf)))
unsigned int resign;
goto cleanup;
static isc_result_t
return (result);
goto cleanup;
goto cleanup;
if (dynamic) {
if (!ok) {
return (result);
if (force)
static isc_result_t
isc_region_t r;
goto skip;
dns_rdatatype_dnskey, &r);
NULL));
skip:
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
return (uresult);
return (result);
static isc_result_t
return (result);
goto failure;
revoked++;
pending++;
trusted++;
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
static isc_result_t
return (result);
static isc_result_t
const char *caller)
const char *journalfile;
&journal);
return (result);
return (result);
static isc_result_t
goto failure;
goto failure;
return (result);
struct addifmissing_arg {
static isc_result_t
goto failure;
goto failure;
if (changed) {
return (result);
return (DNS_R_BADZONE);
return (result);
unsigned int soacount;
static isc_boolean_t
return (answer);
static isc_result_t
unsigned int soacount = 0;
unsigned int nscount = 0;
unsigned int errors = 0;
unsigned int options;
goto cleanup;
goto cleanup;
options = 0;
goto cleanup;
goto cleanup;
&errors);
case dns_zone_dlz:
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_redirect:
if (nscount == 0) {
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
unsigned int oldsoacount;
NULL);
return(ISC_R_SUCCESS);
goto cleanup;
isc_time_t t;
case dns_zone_key:
goto cleanup;
goto cleanup;
zone,
sizeof(isc_event_t));
goto cleanup;
goto cleanup;
if (needdump) {
return (result);
return (result);
static isc_boolean_t
return (ISC_TRUE);
return (ISC_FALSE);
static isc_boolean_t
int level;
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
if (logit) {
return (ISC_FALSE);
if (logit) {
return (ISC_FALSE);
if (logit) {
return (ISC_FALSE);
return (ISC_TRUE);
static isc_result_t
unsigned int count = 0;
unsigned int ecount = 0;
goto success;
goto invalidate_rdataset;
ecount++;
count++;
return (result);
static isc_result_t
unsigned int *soacount,
unsigned int count;
*soacount = 0;
*serial = 0;
*refresh = 0;
*retry = 0;
*expire = 0;
*minimum = 0;
goto invalidate_rdataset;
goto invalidate_rdataset;
count = 0;
count++;
if (count > 0) {
*soacount = 0;
*serial = 0;
*refresh = 0;
*retry = 0;
*expire = 0;
*minimum = 0;
return (result);
static isc_result_t
unsigned int *errors)
*nscount = 0;
*soacount = 0;
*serial = 0;
*refresh = 0;
*retry = 0;
*expire = 0;
*errors = 0;
goto closeversion;
minimum);
return (answer);
unsigned int refs;
if (refs == 0) {
if (free_now) {
if (free_needed)
if (value)
if (value)
if (value)
if (value)
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
static isc_boolean_t
for (i = 0; i < count; i++)
return (ISC_FALSE);
return (ISC_TRUE);
static isc_boolean_t
return (ISC_TRUE);
return (ISC_FALSE);
for (i = 0; i < count; i++) {
return (ISC_FALSE);
return (ISC_TRUE);
unsigned int count;
*countp = 0;
for (i = 0; i < count; i++) {
sizeof(dns_name_t));
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_NOMEMORY);
return (ISC_R_NOMEMORY);
for (i = 0; i < count; i++)
for (i = 0; i < count; i++) {
sizeof(dns_name_t));
goto allocfail;
newnames[i]);
for (i = 0; i < count; i++)
newnames[i],
mctx);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
count));
count));
goto unlock;
if (count == 0)
goto unlock;
goto unlock;
return (ISC_R_SUCCESS);
return (result);
goto unlock;
if (count == 0)
goto unlock;
goto unlock;
for (i = 0; i < count; i++)
goto unlock;
return (result);
return (result);
static inline isc_boolean_t
if (!dumping) {
return (dumping);
static isc_result_t
nkeys);
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
return (result);
unsigned int delta;
isc_time_t t;
timebuf);
static isc_boolean_t
for (i = 0; i < nkeys; i++) {
return (ISC_TRUE);
for (i = 0; i < nkeys; i++) {
return (ISC_FALSE);
return (ISC_TRUE);
* See also update.c:del_keysigs().
static isc_result_t
return (ISC_R_SUCCESS);
goto failure;
return (ISC_R_SUCCESS);
goto failure;
if (warn) {
&rdata);
sizeof(origin));
sizeof(algbuf));
for (i = 0; i < nkeys; i++) {
if (timewarn != 0 &&
if (timemaybe == 0 ||
if (timewarn == 0)
if (timewarn == 0 ||
&rdata);
&rdata);
if (!found)
if (timewarn > 0) {
#if defined(STDTIME_ON_32BITS)
now);
#if defined(STDTIME_ON_32BITS)
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
goto failure;
return (ISC_R_SUCCESS);
goto failure;
for (i = 0; i < nkeys; i++) {
for (j = 0; j < nkeys; j++) {
if (both)
if (both) {
return (result);
unsigned int nkeys = 0;
unsigned int resign;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
for (i = 0; i < nkeys; i++)
static isc_result_t
return (result);
static isc_boolean_t
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
&rdata));
&rdata));
return (result);
static isc_result_t
return (result);
goto failure;
(*signatures)--;
(*signatures)--;
goto next_rdataset;
goto next_rdataset;
} else if (is_ksk) {
goto next_rdataset;
if (*delegation &&
goto next_rdataset;
goto next_rdataset;
(*signatures)--;
if (seen_dname)
return (result);
static isc_result_t
if (update_only) {
goto success;
goto failure;
return (result);
static isc_result_t
goto failure;
goto failure;
goto failure;
} else if (!have_rr) {
if (build_nsec3)
return (result);
static isc_result_t
goto try_private;
goto failure;
goto failure;
if (active)
goto add;
goto add;
goto failure;
if ((!nsec3ok &&
goto failure;
add:
goto failure;
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
return (result);
static isc_result_t
return (result);
return (result);
return (ISC_R_SUCCESS);
return (result);
return (result);
static isc_result_t
return (result);
return (result);
return (ISC_R_SUCCESS);
unsigned int nkeys = 0;
goto failure;
goto failure;
goto failure;
goto next_addchain;
goto next_addchain;
goto next_addchain;
goto next_addnode;
if (first) {
goto next_addnode;
goto next_addnode;
goto failure;
if (seen_nsec)
&nsec3_diff);
goto failure;
¶m_diff));
link);
goto next_addchain;
¶m_diff));
goto same_addchain;
¶m_diff));
link);
goto next_addchain;
goto failure;
} else if (delegation) {
goto skip_removals;
goto next_removechain;
goto next_removechain;
goto failure;
if (first)
if (!buildnsecchain) {
if (first) {
¶m_diff);
goto failure;
&nsec3_diff);
goto failure;
goto next_removenode;
if (first) {
goto next_removenode;
goto next_removenode;
goto failure;
goto next_removenode;
goto same_removechain;
link);
¶m_diff);
goto failure;
goto next_removechain;
goto failure;
} else if (delegation) {
goto failure;
if (rebuild_nsec) {
&nsec_diff);
goto failure;
if (rebuild_nsec3) {
&nsec3_diff);
goto failure;
goto failure;
goto failure;
if (updatensec) {
goto failure;
goto failure;
goto done;
goto failure;
goto failure;
goto failure;
done:
for (i = 0; i < nkeys; i++)
static isc_result_t
return (result);
goto failure;
return (result);
unsigned int nkeys = 0;
goto failure;
goto failure;
goto failure;
goto failure;
goto next_signing;
goto next_signing;
for (i = 0, j = 0; i < nkeys; i++) {
nkeys = j;
if (first) {
goto next_node;
for (i = 0; i < nkeys; i++) {
for (j = 0; j < nkeys; j++) {
if (both)
&post_diff);
goto failure;
&post_diff);
goto failure;
goto next_signing;
goto failure;
} else if (delegation) {
goto failure;
goto pauseall;
goto failure;
goto failure;
goto failure;
if (commit) {
for (i = 0; i < nkeys; i++)
static isc_result_t
case dns_rdatatype_dnskey:
case dns_rdatatype_keydata:
return (result);
INSIST(0);
return (ISC_R_SUCCESS);
static isc_boolean_t
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
static inline isc_stdtime_t
isc_uint32_t t;
if (!retry) {
if (t > exp)
t = exp;
if (t < dns_zone_mkey_hour)
t = dns_zone_mkey_hour;
if (t > exp)
t = exp;
if (t > dns_zone_mkey_day)
t = dns_zone_mkey_day;
if (t < dns_zone_mkey_hour)
t = dns_zone_mkey_hour;
return (now + t);
static isc_result_t
goto failure;
return (result);
static isc_boolean_t
return (ISC_FALSE);
return (answer);
int pending = 0;
goto cleanup;
if (alldone)
goto done;
goto done;
if (!secure) {
&keydatarr));
&keydatarr));
} else if (secure) {
pending++;
pending++;
} else if (secure) {
if (revoked)
if (initializing) {
&keydatarr));
if (updatekey) {
&keydatarr));
} else if (newkey) {
NULL);
&keydatarr));
if (trustkey) {
if (pending != 0)
done:
if (free_needed)
&rdata));
goto failure;
if (fetch_err) {
timebuf);
if (!fetching)
case dns_zone_redirect:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_redirect:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_master:
case dns_zone_slave:
case dns_zone_key:
case dns_zone_redirect:
case dns_zone_stub:
if (!dumping) {
case dns_zone_master:
case dns_zone_redirect:
case dns_zone_key:
case dns_zone_master:
case dns_zone_master:
case dns_zone_redirect:
case dns_zone_slave:
unsigned int soacount;
#ifdef ISC_PLATFORM_USETHREADS
goto again;
goto unlock;
goto unlock;
if (!dumping)
return (result);
if (!dumping)
return (result);
goto again;
switch (tresult) {
case ISC_R_SUCCESS:
case ISC_R_NOSPACE:
case ISC_R_NOTFOUND:
if (compact)
if (again)
static isc_result_t
redo:
goto fail;
goto fail;
fail:
if (again)
goto redo;
return (result);
static isc_result_t
return (DNS_R_NOTLOADED);
if (rawversion == 0)
return (result);
dns_masterformat_text, 0));
dns_masterformat_text, 0));
static isc_boolean_t
goto requeue;
goto requeue;
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_TRUE);
static isc_boolean_t
return (ISC_FALSE);
case PF_INET:
case PF_INET6:
return (ISC_FALSE);
return (ISC_FALSE);
return (isself);
if (!locked)
if (!locked)
if (locked)
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
unsigned int options;
goto destroy;
goto destroy;
static isc_result_t
isc_event_t *e;
if (e == NULL)
return (ISC_R_NOMEMORY);
if (startup)
isc_event_free(&e);
return (result);
goto cleanup;
goto cleanup;
addrbuf);
goto cleanup;
goto cleanup;
goto cleanup_message;
addrbuf);
options = 0;
case PF_INET:
if (!have_notifysource)
if (!have_notifydscp)
case PF_INET6:
if (!have_notifysource)
if (!have_notifydscp)
goto cleanup_key;
unsigned int flags;
NULL))
goto cleanup;
goto cleanup;
unsigned int flags = 0;
if (startup)
goto cleanup1;
goto cleanup2;
goto cleanup3;
goto cleanup3;
if (!loggednotify) {
serial);
goto cleanup3;
goto cleanup3;
if (!loggednotify) {
serial);
if (isqueued) {
static inline isc_result_t
goto fail;
goto fail;
goto fail;
&rdataset);
goto fail;
goto fail;
&rdataset);
goto fail;
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
unsigned int j, soacount;
goto next_master;
goto same_master;
goto next_master;
goto next_master;
goto next_master;
goto same_master;
goto next_master;
goto next_master;
goto same_master;
goto next_master;
if (cnamecnt != 0) {
goto next_master;
if (nscnt == 0) {
goto next_master;
goto next_master;
goto free_stub;
if (!exiting &&
if (!done) {
goto free_stub;
goto free_stub;
goto done;
done:
goto detach;
goto same_master;
&now))
goto tcp_transfer;
goto next_master;
goto next_master;
goto next_master;
goto same_master;
goto same_master;
goto tcp_transfer;
goto next_master;
goto tcp_transfer;
goto next_master;
goto same_master;
goto next_master;
if (cnamecnt != 0) {
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
unsigned int dbsoacount;
NULL);
serial);
goto next_master;
goto next_master;
goto next_master;
goto detach;
if (!done) {
goto requeue;
goto detach;
goto detach;
if (do_queue_xfrin)
isc_event_t *e;
if (e == NULL) {
isc_event_free(&e);
static inline isc_result_t
&message);
goto cleanup;
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
int count = 0;
if (reqnsid) {
count++;
if (reqexpire) {
count++;
return (result);
int timeout;
goto cleanup;
goto cleanup;
goto skip_master;
goto skip_master;
DNS_REQUESTOPT_TCP : 0;
udpsize =
case PF_INET:
goto skip_master;
if (!have_xfrdscp)
} else if (!have_xfrsource) {
if (!have_xfrdscp)
case PF_INET6:
goto skip_master;
if (!have_xfrdscp)
} else if (!have_xfrsource) {
if (!have_xfrdscp)
goto cleanup;
goto skip_master;
if (cancel)
goto again;
goto cleanup;
int timeout;
goto cleanup;
goto cleanup;
goto cleanup;
&node);
goto cleanup;
goto cleanup;
udpsize =
case PF_INET:
if (!have_xfrdscp)
} else if (!have_xfrsource) {
if (!have_xfrdscp)
case PF_INET6:
if (!have_xfrdscp)
} else if (!have_xfrsource) {
if (!have_xfrdscp)
goto cleanup;
goto cleanup;
goto unlock;
if (linked) {
if (free_needed)
case dns_zone_redirect:
goto treat_as_slave;
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_key:
static isc_result_t
isc_region_t r;
&message);
return (result);
goto cleanup;
goto cleanup;
goto done;
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
NULL);
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
isc_buffer_usedregion(b, &r);
goto soa_cleanup;
goto soa_cleanup;
done:
return (ISC_R_SUCCESS);
return (result);
int match = 0;
return (result);
return (DNS_R_FORMERR);
return (DNS_R_NOTIMP);
return (ISC_R_SUCCESS);
match > 0)
return (DNS_R_REFUSED);
&rdataset);
unsigned int soacount;
fromtext);
return (ISC_R_SUCCESS);
if (have_serial)
return (ISC_R_SUCCESS);
if (have_serial)
fromtext);
return (ISC_R_SUCCESS);
const char *fmt, ...)
const char *zstr;
case dns_zone_key:
case dns_zone_redirect:
message);
int count = 0;
count++;
return (count);
if (idlein == 0)
struct secure_event {
isc_event_t e;
static isc_result_t
int n_soa = 0;
return (DNS_R_UNCHANGED);
n_soa++;
soatuplep));
if (n_soa == 0) {
return (ISC_R_FAILURE);
&tuple));
return(result);
static isc_result_t
return (DNS_R_UNCHANGED);
return (result);
return (DNS_R_UNCHANGED);
return (ISC_R_SUCCESS);
goto failure;
goto failure;
if (newserial == 0)
newserial++;
goto failure;
goto nextevent;
static isc_result_t
isc_event_t *e;
sizeof(struct secure_event));
if (e == NULL)
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
static isc_result_t
isc_buffer_t b;
NULL));
oldserial++;
if (oldserial == 0)
oldserial++;
0, NULL));
static isc_result_t
goto getprivate;
goto done;
sizeof(nsec3param_t));
done:
return (result);
static isc_result_t
return (result);
unsigned int oldserial = 0;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
0, &rdataset, 0,
NULL);
goto failure;
static isc_result_t
isc_event_t *e;
sizeof(struct secure_event));
if (e == NULL)
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
goto again;
return (result);
static isc_result_t
unsigned int soacount = 0;
unsigned int nscount = 0;
return (result);
return (result);
return (result);
return (result);
goto fail;
NULL);
goto fail;
goto fail;
if (dump)
switch (result) {
case ISC_R_SUCCESS:
case ISC_R_NOSPACE:
case ISC_R_NOTFOUND:
return (ISC_R_SUCCESS);
fail:
return (result);
unsigned int soacount;
unsigned int nscount;
goto again;
switch (xfrresult) {
case ISC_R_SUCCESS:
case DNS_R_UPTODATE:
goto same_master;
nscount = 0;
soacount = 0;
if (nscount == 0) {
goto next_master;
sizeof(namebuf));
namebuf);
&now);
delay = 0;
case DNS_R_BADIXFR:
goto same_master;
case DNS_R_TOOMANYRECORDS:
switch (result) {
case ISC_R_SUCCESS:
case ISC_R_NOSPACE:
case ISC_R_NOTFOUND:
if (free_needed)
goto again;
goto cleanup;
goto cleanup;
if (!loaded) {
case PF_INET:
case PF_INET6:
INSIST(0);
static isc_result_t
return (ISC_R_CANCELED);
return (ISC_R_NOMORE);
case PF_INET:
case PF_INET6:
goto unlock;
return (result);
goto next_master;
goto next_master;
goto next_master;
case dns_rcode_noerror:
case dns_rcode_yxdomain:
case dns_rcode_yxrrset:
case dns_rcode_nxrrset:
case dns_rcode_refused:
case dns_rcode_nxdomain: {
case dns_rcode_notzone:
case dns_rcode_notauth: {
goto next_master;
case dns_rcode_formerr:
case dns_rcode_servfail:
case dns_rcode_notimp:
case dns_rcode_badvers:
goto next_master;
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
goto cleanup;
return (result);
return (ISC_R_NOMORE);
return (ISC_R_SUCCESS);
return (ISC_R_NOMORE);
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
goto free_mem;
goto free_rwlock;
goto free_urlock;
goto free_task;
goto free_notifyrl;
goto free_refreshrl;
goto free_startupnotifyrl;
goto free_startuprefreshrl;
return (ISC_R_SUCCESS);
return (result);
void *item;
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (result);
return (ISC_R_FAILURE);
goto cleanup_tasks;
goto unlock;
return (result);
if (free_now)
if (free_now)
dns_zone_t *p;
p != NULL;
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
return (result);
if (multi)
static isc_result_t
dns_zone_t *x;
isc_event_t *e;
goto gotquota;
x != NULL;
LOCK_ZONE(x);
UNLOCK_ZONE(x);
nxfrsin++;
nxfrsperns++;
return (ISC_R_QUOTA);
return (ISC_R_QUOTA);
if (e == NULL)
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_NOMEMORY);
if (queue) {
if (!queue)
return (ISC_R_SUCCESS);
if (send_event) {
char *buf;
int buflen;
goto cleanup;
goto cleanup;
if (value == 0)
ns = 0;
for (i = 0; i < UNREACH_CHACHE_SIZE; i++) {
for (i = 0; i < UNREACH_CHACHE_SIZE; i++) {
for (i = 0; i < UNREACH_CHACHE_SIZE; i++) {
slot = i;
oldest = i;
if (i < UNREACH_CHACHE_SIZE) {
return (ISC_R_NOTIMPLEMENTED);
return (NULL);
return (NULL);
return (NULL);
switch (dialup) {
case dns_dialuptype_no:
case dns_dialuptype_yes:
case dns_dialuptype_notify:
case dns_dialuptype_refresh:
case dns_dialuptype_passive:
INSIST(0);
return (result);
unsigned int count = 0;
switch (state) {
count++;
count++;
case DNS_ZONESTATE_SOAQUERY:
count++;
case DNS_ZONESTATE_ANY:
count++;
case DNS_ZONESTATE_AUTOMATIC:
count++;
INSIST(0);
return (count);
return (ISC_R_SUCCESS);
if (!ok) {
if (fail)
return (DNS_R_BADOWNERNAME);
if (!ok) {
if (fail)
return (DNS_R_BADNAME);
return (ISC_R_SUCCESS);
return (result);
salt);
return (result);
if (nodes == 0)
else if (signatures == 0)
static isc_result_t
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
return (result);
static isc_result_t
for (i = 0; i <= DST_MAX_TIMES; i++) {
if (then != 0) {
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
static isc_result_t
goto failure;
return (result);
static isc_result_t
isc_region_t r;
if (flag)
if (flag) {
return (result);
static isc_result_t
unsigned int nkeys = 0, i;
return (result);
goto failure;
goto failure;
goto failure;
for (i = 0; i < nkeys; i++)
return (result);
* See update.c:check_dnssec()
static isc_boolean_t
if (!nseconly) {
if (!nsec3)
goto failure;
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
goto failure;
return (result);
static isc_boolean_t
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
&build_nsec3));
if (build_nsec3)
return (result);
const char *dir;
&dnskeys));
goto failure;
&keys);
goto failure;
goto failure;
if (commit) {
ISC_TRUE);
if (fullsign) {
} else if (newalg) {
&timethen);
done:
goto done;
if (fullsign)
unsigned int *errors)
return (result);
return (result);
return (result);
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
for (i = 0; i < sizeof(algorithms); i++) {
goto failure;
NULL));
goto failure;
for (i = 0; i < sizeof(algorithms); i++) {
goto failure;
return (result);
goto again;
return result;
if (interval == 0)
return (ISC_R_RANGE);
return (ISC_R_SUCCESS);
goto unlock;
return (result);
struct keydone {
goto failure;
goto failure;
goto failure;
goto failure;
goto failure;
if (found)
&rdata));
if (!clear_pending)
isc_event_t *e;
isc_buffer_t b;
if (e == NULL) {
goto failure;
const char *algstr;
size_t n;
algstr++;
isc_buffer_putuint8(&b, 0);
if (e != NULL)
isc_event_free(&e);
return (result);
goto failure;
goto failure;
goto failure;
goto failure;
if (commit)
isc_buffer_t b;
isc_event_t *e;
if (e == NULL) {
goto failure;
if (hash == 0) {
¶m, &b));
if (e != NULL)
isc_event_free(&e);
return (result);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
dns_include_t *include;
goto done;
goto done;
include != NULL;
done:
goto failure;
goto failure;
goto failure;
if (desired == 0U)
goto failure;
goto failure;
goto failure;
if (e == NULL) {
goto failure;
if (e != NULL)
isc_event_free(&e);
return (result);