zone.c revision b6e20238b660ea9ad7dd67cc3f0d2763c9da4449
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Copyright (C) 1999-2001 Internet Software Consortium.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Permission to use, copy, modify, and distribute this software for any
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * purpose with or without fee is hereby granted, provided that the above
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * copyright notice and this permission notice appear in all copies.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson/* $Id: zone.c,v 1.361 2002/01/23 02:03:04 gson Exp $ */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define ZONE_MAGIC ISC_MAGIC('Z', 'O', 'N', 'E')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONE_VALID(zone) ISC_MAGIC_VALID(zone, ZONE_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define NOTIFY_MAGIC ISC_MAGIC('N', 't', 'f', 'y')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_NOTIFY_VALID(notify) ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define STUB_MAGIC ISC_MAGIC('S', 't', 'u', 'b')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_STUB_VALID(stub) ISC_MAGIC_VALID(stub, STUB_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define ZONEMGR_MAGIC ISC_MAGIC('Z', 'm', 'g', 'r')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEMGR_VALID(stub) ISC_MAGIC_VALID(stub, ZONEMGR_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define LOAD_MAGIC ISC_MAGIC('L', 'o', 'a', 'd')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_LOAD_VALID(load) ISC_MAGIC_VALID(load, LOAD_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define FORWARD_MAGIC ISC_MAGIC('F', 'o', 'r', 'w')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_FORWARD_VALID(load) ISC_MAGIC_VALID(load, FORWARD_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define IO_MAGIC ISC_MAGIC('Z', 'm', 'I', 'O')
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_IO_VALID(load) ISC_MAGIC_VALID(load, IO_MAGIC)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Ensure 'a' is at least 'min' but not more than 'max'.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson (((a) < (min)) ? (min) : ((a) < (max) ? (a) : (max)))
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Default values.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_DEFAULT_IDLEIN 3600 /* 1 hour */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_DEFAULT_IDLEOUT 3600 /* 1 hour */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define MAX_XFER_TIME (2*3600) /* Documented default is 2 hours */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_MAX_EXPIRE 14515200 /* 24 weeks */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_DUMP_DELAY 900 /* 15 minutes */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson do { (z)->locked = ISC_FALSE; UNLOCK(&(z)->lock); } while (0)
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson /* Unlocked */
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson ISC_LINK(dns_zone_t) link; /* Used by zmgr. */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson /* Access Control Lists */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Zones in certain states such as "waiting for zone transfer"
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * or "zone transfer in progress" are kept on per-state linked lists
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * in the zone manager using the 'statelink' field. The 'statelist'
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * field points at the list the zone is currently on. It the zone
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * is not on any such list, statelist is NULL.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Optional per-zone statistics counters (NULL if not present).
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONE_FLAG(z,f) (ISC_TF(((z)->flags & (f)) != 0))
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONE_SETFLAG(z,f) do { \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson (z)->flags |= (f); \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONE_CLRFLAG(z,f) do { \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson (z)->flags &= ~(f); \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson /* XXX MPA these may need to go back into zone.h */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_REFRESH 0x00000001U /* refresh check in progress */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_NEEDDUMP 0x00000002U /* zone need consolidation */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_USEVC 0x00000004U /* use tcp for refresh query */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_DUMPING 0x00000008U /* a dump is in progress */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_HASINCLUDE 0x00000010U /* $INCLUDE in zone file */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_LOADED 0x00000020U /* database has loaded */
b120e39deac3e9c323cdc7801ed2313f8ebbb744Andreas Gustafsson#define DNS_ZONEFLG_EXITING 0x00000040U /* zone is being destroyed */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_EXPIRED 0x00000080U /* zone has expired */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_NEEDREFRESH 0x00000100U /* refresh check needed */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_UPTODATE 0x00000200U /* zone contents are
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_NEEDNOTIFY 0x00000400U /* need to send out notify
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_DIFFONRELOAD 0x00000800U /* generate a journal diff on
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_NOMASTERS 0x00001000U /* an attempt to refresh a
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * zone with no masters
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_LOADING 0x00002000U /* load from disk in progress*/
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_HAVETIMERS 0x00004000U /* timer values have been set
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * from SOA (if not set, we
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * are still using
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * default timer values) */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_FORCEXFER 0x00008000U /* Force a zone xfer */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_DIALNOTIFY 0x00020000U
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLG_DIALREFRESH 0x00040000U
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONEFLAG_NOIXFR 0x00100000U /* IXFR failed, force AXFR */
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson#define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson/* Flags for zone_load() */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONELOADFLAG_NOSTAT 0x00000001U /* Do not stat() master files */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson /* Locked by rwlock. */
8f79820c6930ee5ef6b4a54f36d2559400bdf47dAndreas Gustafsson /* Configuration data. */
8f79820c6930ee5ef6b4a54f36d2559400bdf47dAndreas Gustafsson /* Locked by iolock */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Hold notify state.
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson * dns_stub holds state while performing a 'stub' transfer.
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson * 'db' is the zone's 'db' or a new one if this is the initial
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson * Hold load state.
8f79820c6930ee5ef6b4a54f36d2559400bdf47dAndreas Gustafsson * Hold forward state.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson * Hold IO request state.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_settimer(dns_zone_t *, isc_time_t *);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_debuglog(dns_zone_t *zone, const char *, int debuglevel,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson const char *msg, ...) ISC_FORMAT_PRINTF(4, 5);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void notify_log(dns_zone_t *zone, int level, const char *fmt, ...)
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic void queue_xfrin(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_unload(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_expire(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_iattach(dns_zone_t *source, dns_zone_t **target);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_idetach(dns_zone_t **zonep);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t zone_replacedb(dns_zone_t *zone, dns_db_t *db,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t default_journal(dns_zone_t *zone);
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic void zone_xfrdone(dns_zone_t *zone, isc_result_t result);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t zone_postload(dns_zone_t *zone, dns_db_t *db,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson isc_time_t loadtime, isc_result_t result);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_needdump(dns_zone_t *zone, unsigned int delay);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_shutdown(isc_task_t *, isc_event_t *);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_loaddone(void *arg, isc_result_t result);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t zone_startload(dns_db_t *db, dns_zone_t *zone,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson/* ondestroy example */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void dns_zonemgr_dbdestroyed(isc_task_t *task, isc_event_t *event);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void refresh_callback(isc_task_t *, isc_event_t *);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void stub_callback(isc_task_t *, isc_event_t *);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void queue_soa_query(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void soa_query(isc_task_t *, isc_event_t *);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset,
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic int message_count(dns_message_t *msg, dns_section_t section,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void notify_cancel(dns_zone_t *zone);
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic void notify_find_address(dns_notify_t *notify);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void notify_send(dns_notify_t *notify);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t notify_createmessage(dns_zone_t *zone,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void notify_done(isc_task_t *task, isc_event_t *event);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void notify_send_toaddr(isc_task_t *task, isc_event_t *event);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t zone_dump(dns_zone_t *, isc_boolean_t);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void got_transfer_quota(isc_task_t *task, isc_event_t *event);
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic isc_result_t zmgr_start_xfrin_ifquota(dns_zonemgr_t *zmgr,
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic void zmgr_resume_xfrs(dns_zonemgr_t *zmgr);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zonemgr_free(dns_zonemgr_t *zmgr);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic isc_result_t zonemgr_getio(dns_zonemgr_t *zmgr, isc_boolean_t high,
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson isc_task_t *task, isc_taskaction_t action,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zonemgr_putio(dns_io_t **iop);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zonemgr_cancelio(dns_io_t *io);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonzone_get_from_db(dns_db_t *db, dns_name_t *origin, unsigned int *nscount,
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson unsigned int *soacount, isc_uint32_t *serial,
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafsson isc_uint32_t *refresh, isc_uint32_t *retry,
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson isc_uint32_t *expire, isc_uint32_t *minimum);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_freedbargs(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void forward_callback(isc_task_t *task, isc_event_t *event);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_saveunique(dns_zone_t *zone, const char *path,
9b0e18da3d5c2290f90b285d122d368173f17c63Andreas Gustafssonstatic void zone_maintenance(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void zone_notify(dns_zone_t *zone);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic void dump_done(void *arg, isc_result_t result);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define ENTER zone_debuglog(zone, me, 1, "enter")
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic const unsigned int dbargc_default = 1;
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssonstatic const char *dbargv_default[] = { "rbt" };
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson if (isc_time_add((a), &_i, (c)) != ISC_R_SUCCESS) { \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson "epoch approaching: upgrade required: " \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson "now + %s failed", #b); \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson#define DNS_ZONE_TIME_ADD(a, b, c) \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson if (isc_time_add((a), &_i, (c)) != ISC_R_SUCCESS) { \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson "epoch approaching: upgrade required: " \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson "now + %s failed", #b); \
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson *** Public functions.
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafssondns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson REQUIRE(zonep != NULL && *zonep == NULL);
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson "isc_mutex_init() failed: %s",
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson /* XXX MPA check that all elements are initialised */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson isc_refcount_init(&zone->erefs, 1); /* Implicit attach. */
f951f076f3d321c52b824a866caff28ce4f8e06cAndreas Gustafsson zone->sigvalidityinterval = 30 * 24 * 3600;
goto free_mutex;
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
== ISC_R_SUCCESS);
== ISC_R_SUCCESS);
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);
static isc_result_t
char *journal;
return (ISC_R_NOMEMORY);
return (result);
return (result);
static isc_boolean_t
static isc_result_t
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
&filetime);
goto cleanup;
&db);
goto cleanup;
goto cleanup;
goto cleanup;
return (result);
unsigned int options;
goto fail;
goto fail;
fail:
goto fail;
goto fail;
fail:
static isc_result_t
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
unsigned int options;
return (result);
return (result);
return (result);
static isc_result_t
unsigned int soacount = 0;
unsigned int nscount = 0;
goto cleanup;
goto cleanup;
goto cleanup;
nscount = 0;
soacount = 0;
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
if (nscount == 0) {
goto cleanup;
isc_time_t t;
goto cleanup;
zone,
sizeof(isc_event_t));
goto cleanup;
if (needdump)
return (result);
return (result);
static isc_boolean_t
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
unsigned int *nscount)
unsigned int count;
*nscount = 0;
goto invalidate_rdataset;
goto invalidate_rdataset;
count = 0;
count++;
return (result);
static isc_result_t
unsigned int *soacount,
unsigned int count;
goto invalidate_rdataset;
count = 0;
count++;
if (count > 0) {
return (result);
static isc_result_t
goto closeversion;
minimum);
return (answer);
unsigned int refs;
if (refs == 0) {
if (free_now)
if (free_needed)
if (value)
if (value)
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
if (count != 0) {
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (result);
sizeof(dns_name_t));
if (count == 0)
goto unlock;
goto unlock;
goto unlock;
for (i = 0; i < count; i++)
for (i = 0; i < count; i++) {
sizeof(dns_name_t));
goto allocfail;
newname[i]);
for (i = 0; i < count; i++)
newname[i],
goto unlock;
return (result);
return (result);
static inline isc_boolean_t
if (!dumping) {
return (dumping);
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_master:
case dns_zone_slave:
if (!dumping) {
case dns_zone_master:
case dns_zone_slave:
goto unlock;
goto unlock;
if (!dumping)
return (result);
if (!dumping)
return (result);
switch (tresult) {
case ISC_R_SUCCESS:
case ISC_R_NOSPACE:
case ISC_R_NOTFOUND:
static isc_result_t
redo:
goto fail;
goto fail;
if (compact) {
fail:
if (again)
goto redo;
return (result);
return (DNS_R_NOTLOADED);
return (result);
static isc_boolean_t
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_FALSE);
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);
isc_event_free(&e);
return (result);
int timeout;
goto cleanup;
goto cleanup;
addrbuf);
goto cleanup;
goto cleanup;
addrbuf);
case PF_INET:
case PF_INET6:
goto cleanup_key;
&new);
goto cleanup;
goto cleanup;
unsigned int flags = 0;
goto cleanup1;
goto cleanup2;
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;
&rdataset);
goto fail;
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
master);
goto next_master;
goto same_master;
master);
goto next_master;
if (cnamecnt != 0) {
goto next_master;
if (nscnt == 0) {
goto next_master;
goto next_master;
goto free_stub;
goto free_stub;
goto free_stub;
goto done;
done:
master);
goto next_master;
goto next_master;
goto next_master;
goto next_master;
master);
goto tcp_transfer;
master);
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;
goto next_master;
goto next_master;
goto detach;
goto detach;
goto detach;
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);
int timeout;
goto cleanup;
goto cleanup;
DNS_REQUESTOPT_TCP : 0;
case PF_INET:
case PF_INET6:
goto cleanup;
goto cleanup;
if (cancel)
int timeout;
goto cleanup;
goto cleanup;
&node);
goto cleanup;
goto cleanup;
case PF_INET:
case PF_INET6:
goto cleanup;
goto cleanup;
goto unlock;
if (free_needed)
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
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 (DNS_R_FORMERR);
return (DNS_R_NOTIMP);
return (ISC_R_SUCCESS);
match > 0)
return (DNS_R_REFUSED);
&rdataset);
fromtext);
return (ISC_R_SUCCESS);
fromtext);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
const char *fmt, ...)
int count = 0;
count++;
return (count);
if (idlein == 0)
return (result);
static isc_result_t
goto fail;
if (dump)
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
unsigned int soacount;
unsigned int nscount;
switch (result) {
case ISC_R_SUCCESS:
case DNS_R_UPTODATE:
goto same_master;
&now);
nscount = 0;
soacount = 0;
if (nscount == 0)
case DNS_R_BADIXFR:
goto same_master;
goto cleanup;
static isc_result_t
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_taskpool;
goto free_task;
goto free_rl;
return (ISC_R_SUCCESS);
return (result);
goto cleanup_task;
goto unlock;
return (result);
if (free_now)
if (free_now)
dns_zone_t *p;
p != NULL;
return (ISC_R_SUCCESS);
static isc_result_t
dns_zone_t *x;
isc_event_t *e;
x != NULL;
nxfrsin++;
nxfrsperns++;
return (ISC_R_QUOTA);
return (ISC_R_QUOTA);
sizeof(isc_event_t));
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;
if (on) {
goto done;
goto done;
done:
return (result);
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++;
INSIST(0);
return (count);