adb.c revision ebdd11e84734e28ddd64562e82a7c646a58a04f4
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 1999 Internet Software Consortium.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Permission to use, copy, modify, and distribute this software for any
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * purpose with or without fee is hereby granted, provided that the above
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15a44745412679c30a6d022733925af70a38b715David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
15a44745412679c30a6d022733925af70a38b715David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15a44745412679c30a6d022733925af70a38b715David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence * Implementation notes
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * --------------------
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence * In finds, if task == NULL, no events will be generated, and no events
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence * have been sent. If task != NULL but taskaction == NULL, an event has been
364a82f7c25b62967678027043425201a5e5171aBob Halley * posted but not yet freed. If neigher are NULL, no event was posted.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define DNS_ADB_VALID(x) ISC_MAGIC_VALID(x, DNS_ADB_MAGIC)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBNAME_MAGIC 0x6164624e /* adbN. */
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define DNS_ADBNAME_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBNAME_MAGIC)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBNAMEHOOK_MAGIC 0x61644e48 /* adNH. */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBNAMEHOOK_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBNAMEHOOK_MAGIC)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBZONEINFO_MAGIC 0x6164625a /* adbZ. */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBZONEINFO_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBZONEINFO_MAGIC)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBENTRY_MAGIC 0x61646245 /* adbE. */
b3e77535185043f089b346166440402d092030c3David Lawrence#define DNS_ADBENTRY_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBENTRY_MAGIC)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBFETCH_MAGIC 0x61644634 /* adF4. */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBFETCH_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFETCH_MAGIC)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Lengths of lists needs to be small primes.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBNAMELIST_LENGTH 31 /* how many buckets for names */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define DNS_ADBENTRYLIST_LENGTH 31 /* how many buckets for addresses */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define CLEAN_SECONDS 20 /* clean this many seconds initially */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define FREE_ITEMS 16 /* free count for memory pools */
b3e77535185043f089b346166440402d092030c3David Lawrence#define FILL_COUNT 8 /* fill count for memory pools */
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define DNS_ADB_INVALIDBUCKET (-1) /* invalid bucket address */
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristertypedef ISC_LIST(dns_adbname_t) dns_adbnamelist_t;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristertypedef struct dns_adbnamehook dns_adbnamehook_t;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristertypedef ISC_LIST(dns_adbnamehook_t) dns_adbnamehooklist_t;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristertypedef struct dns_adbzoneinfo dns_adbzoneinfo_t;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristertypedef ISC_LIST(dns_adbentry_t) dns_adbentrylist_t;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister unsigned int magic;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister unsigned int irefcnt;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Bucketized locks and lists for names.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence dns_adbnamelist_t names[DNS_ADBNAMELIST_LENGTH];
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister isc_mutex_t namelocks[DNS_ADBNAMELIST_LENGTH];
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister isc_boolean_t name_sd[DNS_ADBNAMELIST_LENGTH];
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence unsigned int name_refcnt[DNS_ADBNAMELIST_LENGTH];
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Bucketized locks for entries.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence dns_adbentrylist_t entries[DNS_ADBENTRYLIST_LENGTH];
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister isc_mutex_t entrylocks[DNS_ADBENTRYLIST_LENGTH];
b3e77535185043f089b346166440402d092030c3David Lawrence * XXX: This has a pointer to the adb it came from. It shouldn't need
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * this, but I can't think of how to get rid of it. In particular, since
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * events have but one "arg" value, and that is currently used for the name
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * pointer in fetches, we need a way to get to the fetch contexts as well
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * as the adb itself.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence unsigned int magic;
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence unsigned int magic;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * dns_adbnamehook_t
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * This is a small widget that dangles off a dns_adbname_t. It contains a
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * pointer to the address information about this host, and a link to the next
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * namehook that will contain the next address this host has.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister unsigned int magic;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * dns_adbzoneinfo_t
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * This is a small widget that holds zone-specific information about an
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * address. Currently limited to lameness, but could just as easily be
b3e77535185043f089b346166440402d092030c3David Lawrence * extended to other types of information about zones.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister unsigned int magic;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * An address entry. It holds quite a bit of information about addresses,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * including edns state, rtt, and of course the address of the host.
5475a2d296215b7a93bd89804dc33c36a6de7cb5James Brister unsigned int magic;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister unsigned int refcnt;
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence unsigned int srtt;
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Internal functions (and prototypes).
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbname_t *new_adbname(dns_adb_t *, dns_name_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void free_adbname(dns_adb_t *, dns_adbname_t **);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbnamehook_t *new_adbnamehook(dns_adb_t *,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void free_adbnamehook(dns_adb_t *, dns_adbnamehook_t **);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbzoneinfo_t *new_adbzoneinfo(dns_adb_t *, dns_name_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void free_adbzoneinfo(dns_adb_t *, dns_adbzoneinfo_t **);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbentry_t *new_adbentry(dns_adb_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void free_adbentry(dns_adb_t *, dns_adbentry_t **);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbfind_t *new_adbfind(dns_adb_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void free_adbfind(dns_adb_t *, dns_adbfind_t **);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbaddrinfo_t *new_adbaddrinfo(dns_adb_t *,
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencestatic inline dns_adbfetch_t *new_adbfetch(dns_adb_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void free_adbfetch(dns_adb_t *, dns_adbfetch_t **);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbname_t *find_name_and_lock(dns_adb_t *, dns_name_t *,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline dns_adbentry_t *find_entry_and_lock(dns_adb_t *,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void print_dns_name(FILE *, dns_name_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void print_namehook_list(FILE *, dns_adbname_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void print_find_list(FILE *, dns_adbname_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void print_fetch_list(FILE *, dns_adbname_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void inc_adb_irefcnt(dns_adb_t *, isc_boolean_t);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void dec_adb_irefcnt(dns_adb_t *, isc_boolean_t);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void inc_adb_erefcnt(dns_adb_t *, isc_boolean_t);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void dec_adb_erefcnt(dns_adb_t *, isc_boolean_t);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void inc_entry_refcnt(dns_adb_t *, dns_adbentry_t *,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void dec_entry_refcnt(dns_adb_t *, dns_adbentry_t *,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void violate_locking_hierarchy(isc_mutex_t *, isc_mutex_t *);
b3e77535185043f089b346166440402d092030c3David Lawrencestatic void clean_namehooks(dns_adb_t *, dns_adbnamehooklist_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void clean_finds_at_name(dns_adbname_t *, isc_eventtype_t);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void check_expire_namehooks(dns_adbname_t *, isc_stdtime_t);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencestatic void cancel_fetches_at_name(dns_adb_t *, dns_adbname_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic isc_result_t dbfind_name(dns_adbfind_t *, dns_name_t *,
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic isc_result_t fetch_name_v4(dns_adbname_t *, isc_stdtime_t now);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic isc_result_t fetch_name_aaaa(dns_adbname_t *, isc_stdtime_t now);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencestatic void timer_cleanup(isc_task_t *, isc_event_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic inline void link_name(dns_adb_t *, int, dns_adbname_t *);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencestatic inline void unlink_name(dns_adb_t *, dns_adbname_t *);
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerstatic void kill_name(dns_adbname_t **, isc_eventtype_t ev);
f3ca27e9fe307b55e35ea8d7b37351650630e5a3Andreas Gustafsson#define EVENT_SENT(h) (((h)->flags & FIND_EVENT_SENT) != 0)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define EVENT_FREED(h) (((h)->flags & FIND_EVENT_FREED) != 0)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define WANTEVENT(x) (((x) & DNS_ADBFIND_WANTEVENT) != 0)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define WANTEMPTYEVENT(x) (((x) & DNS_ADBFIND_EMPTYEVENT) != 0)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define HAVE_INET(n) (!ISC_LIST_EMPTY((n)->v4))
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define HAVE_INET6(n) (!ISC_LIST_EMPTY((n)->v6))
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define HAVE_ADDRS(h) (!ISC_LIST_EMPTY((h)->list))
b3e77535185043f089b346166440402d092030c3David Lawrence#define QUERY_INET(x) (((x) & DNS_ADBFIND_INET) != 0)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define QUERY_INET6(x) (((x) & DNS_ADBFIND_INET6) != 0)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define QUERYPENDING(x, y) (((x) & (y)) != 0)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister#define WANT_INET(x) (((x) & DNS_ADBFIND_INET) != 0)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define WANT_INET6(x) (((x) & DNS_ADBFIND_INET6) != 0)
b3e77535185043f089b346166440402d092030c3David Lawrence#define WANTEDADDR(x, y) (((x) & (y)) != 0)
b3e77535185043f089b346166440402d092030c3David Lawrence#define NO_FETCHES_AAAA(n) ((n)->fetch_aaaa == NULL)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence#define NO_FETCHES_A6(n) (ISC_LIST_EMPTY((n)->fetches_v6))
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Requires the adbname bucket be locked and that no entry buckets be locked.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * This code handles A and AAAA rdatasets only.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerimport_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
5475a2d296215b7a93bd89804dc33c36a6de7cb5James Brister dns_adbentry_t *foundentry; /* NO CLEAN UP! */
b3e77535185043f089b346166440402d092030c3David Lawrence INSIST((rdtype == dns_rdatatype_a) || (rdtype == dns_rdatatype_aaaa));
5475a2d296215b7a93bd89804dc33c36a6de7cb5James Brister foundentry = find_entry_and_lock(adb, &sockaddr, &addr_bucket);
b3e77535185043f089b346166440402d092030c3David Lawrence if (now + rdataset->ttl < adbname->expire_v4)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Lie a little here. This is more or less so code that cares
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * can find out if any new information was added or not.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Requires the name's bucket be locked.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristerkill_name(dns_adbname_t **n, isc_eventtype_t ev)
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * If we're dead already, just check to see if we should go
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * away now or not.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Clean up the name's various lists. These two are destructive
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * in that they will always empty the list.
b3e77535185043f089b346166440402d092030c3David Lawrence * If fetches are running, cancel them. If none are running, we can
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * just kill the name here.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Requires the name's bucket be locked and no entry buckets be locked.
2cde028c51055c9fd4837337116cd4fdfe8ff623James Bristercheck_expire_namehooks(dns_adbname_t *name, isc_stdtime_t now)
2cde028c51055c9fd4837337116cd4fdfe8ff623James Brister * Check to see if we need to remove the v4 addresses
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington if (QUERY_INET(name->query_pending) && (name->expire_v4 < now)) {
15c5b240a6122795212c1aff03634e7156951e91Brian Wellington * Check to see if we need to remove the v6 addresses
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington if (QUERY_INET6(name->query_pending) && (name->expire_v6 < now)) {
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington name->partial_result &= ~DNS_ADBFIND_INET6;
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington * Requires the name's bucket be locked.
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellingtonstatic inline void
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellingtonlink_name(dns_adb_t *adb, int bucket, dns_adbname_t *name)
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington INSIST(name->lock_bucket == DNS_ADB_INVALIDBUCKET);
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington ISC_LIST_PREPEND(adb->names[bucket], name, plink);
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellington * Requires the name's bucket be locked.
590f840d3484114576d9f8a7f7d73fbe31228888Brian Wellingtonstatic inline void
int bucket;
int bucket;
int addr_bucket;
if (lock)
if (lock)
if (lock)
if (lock)
if (lock)
if (lock)
if (lock)
if (lock)
int bucket;
if (lock)
if (lock)
int bucket;
if (lock)
if (lock)
if (!destroy_entry)
static inline dns_adbname_t *
return (NULL);
return (NULL);
return (name);
dns_adbname_t *n;
n = *name;
n->magic = 0;
static inline dns_adbnamehook_t *
return (NULL);
return (nh);
static inline dns_adbzoneinfo_t *
return (NULL);
return (NULL);
return (zi);
static inline dns_adbentry_t *
dns_adbentry_t *e;
isc_uint32_t r;
if (e == NULL)
return (NULL);
e->refcnt = 0;
e->flags = 0;
e->goodness = 0;
dns_adbentry_t *e;
e = *entry;
e->magic = 0;
static inline dns_adbfind_t *
dns_adbfind_t *h;
if (h == NULL)
return (NULL);
h->magic = 0;
h->query_pending = 0;
h->partial_result = 0;
h->options = 0;
h->flags = 0;
return (NULL);
static inline dns_adbfetch_t *
dns_adbfetch_t *f;
if (f == NULL)
return (NULL);
f->magic = 0;
goto err;
goto err;
err:
return (NULL);
dns_adbfetch_t *f;
f = *fetch;
f->magic = 0;
static inline dns_adbaddrinfo_t *
return (NULL);
return (ai);
static inline dns_adbname_t *
int bucket;
return (adbname);
return (NULL);
static inline dns_adbentry_t *
int bucket;
return (entry);
return (NULL);
static isc_boolean_t
return (ISC_FALSE);
return (is_bad);
int bucket;
goto nextv4;
goto out;
goto nextv6;
goto out;
out:
return (ISC_R_NOMEMORY);
goto fail0a;
goto fail0b;
goto fail0c;
goto fail1;
for (i = 0 ; i < DNS_ADBNAMELIST_LENGTH ; i++) {
for (i = 0 ; i < DNS_ADBENTRYLIST_LENGTH ; i++)
goto fail2;
#define MPINIT(t, p, l, n) do { \
goto fail3; \
isc_mempool_setname((p), n); \
goto fail3;
goto fail3;
return (ISC_R_SUCCESS);
return (result);
int bucket;
unsigned int wanted_addresses;
if (now == 0) {
return (result);
return (ISC_R_NOMEMORY);
goto out;
goto out;
goto v6;
adbname));
goto v6;
v6:
adbname));
goto copy;
adbname));
goto copy;
copy:
& wanted_addresses);
out:
if (attach_to_task) {
return (result);
int name_bucket;
return (ISC_R_NOTFOUND);
if (decr_adbrefcnt)
return (DNS_R_SUCCESS);
if (now == 0) {
return (result);
goto out;
goto out;
goto out;
goto out;
return (ISC_R_SUCCESS);
out:
if (free_name)
if (free_entry)
if (free_namehook)
return (result);
int bucket;
int bucket;
goto cleanup;
const char *tmpp;
for (i = 0 ; i < DNS_ADBNAMELIST_LENGTH ; i++)
for (i = 0 ; i < DNS_ADBENTRYLIST_LENGTH ; i++)
for (i = 0 ; i < DNS_ADBNAMELIST_LENGTH ; i++) {
for (i = 0 ; i < DNS_ADBENTRYLIST_LENGTH ; i++) {
case AF_INET:
case AF_INET6:
for (i = 0 ; i < DNS_ADBENTRYLIST_LENGTH ; i++)
for (i = 0 ; i < DNS_ADBNAMELIST_LENGTH ; i++)
const char *tmpp;
case AF_INET:
case AF_INET6:
isc_buffer_t b;
static isc_result_t
return (ISC_R_NOTIMPLEMENTED);
switch (result) {
case DNS_R_GLUE:
case DNS_R_HINT:
case DNS_R_SUCCESS:
return (result);
int bucket;
(void)task;
if (decr_adbrefcnt)
goto out;
out:
int bucket;
(void)task;
if (decr_adbrefcnt)
goto out;
out:
static isc_result_t
goto cleanup;
goto cleanup;
goto cleanup;
return (result);
static isc_result_t
goto cleanup;
goto cleanup;
goto cleanup;
return (result);
int bucket;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
int goodness_adjustment)
int bucket;
if (goodness_adjustment == 0)
if (goodness_adjustment > 0) {
int bucket;
unsigned int new_srtt;
if (factor == 0)