adb.c revision 6a0f1e6b6145591cf52cfe4e05f1b5024d860681
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * Copyright (C) 1999 Internet Software Consortium.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * Permission to use, copy, modify, and distribute this software for any
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * purpose with or without fee is hereby granted, provided that the above
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * copyright notice and this permission notice appear in all copies.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * Implementation notes
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * --------------------
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * In finds, if task == NULL, no events will be generated, and no events
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * have been sent. If task != NULL but taskaction == NULL, an event has been
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * posted but not yet freed. If neither are NULL, no event was posted.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * After we have cleaned all buckets, dump the database contents.
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek#define DNS_ADB_VALID(x) ISC_MAGIC_VALID(x, DNS_ADB_MAGIC)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define DNS_ADBNAME_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBNAME_MAGIC)
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek#define DNS_ADBNAMEHOOK_MAGIC 0x61644e48 /* adNH. */
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek#define DNS_ADBNAMEHOOK_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBNAMEHOOK_MAGIC)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define DNS_ADBZONEINFO_MAGIC 0x6164625a /* adbZ. */
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define DNS_ADBZONEINFO_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBZONEINFO_MAGIC)
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek#define DNS_ADBENTRY_MAGIC 0x61646245 /* adbE. */
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek#define DNS_ADBENTRY_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBENTRY_MAGIC)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define DNS_ADBFETCH_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFETCH_MAGIC)
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek#define DNS_ADBFETCH6_MAGIC 0x61644636 /* adF6. */
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define DNS_ADBFETCH6_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFETCH6_MAGIC)
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * The number of buckets needs to be a prime (for good hashing).
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * XXXRTH How many buckets do we need?
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * This value must be coordinated with CLEAN_SECONDS (below).
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NBUCKETS 1009 /* how many buckets for names/addrs */
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * For type 3 negative cache entries, we will remember that the address is
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * broken for this long.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * Clean one bucket every CLEAN_SECONDS.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FREE_ITEMS 16 /* free count for memory pools */
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FILL_COUNT 8 /* fill count for memory pools */
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define DNS_ADB_INVALIDBUCKET (-1) /* invalid bucket address */
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenytypedef ISC_LIST(dns_adbname_t) dns_adbnamelist_t;
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenytypedef ISC_LIST(dns_adbnamehook_t) dns_adbnamehooklist_t;
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenytypedef ISC_LIST(dns_adbentry_t) dns_adbentrylist_t;
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny unsigned int magic;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int irefcnt;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int erefcnt;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * Bucketized locks and lists for names.
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * XXXRTH Have a per-bucket structure that contains all of these?
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * Bucketized locks for entries.
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * XXXRTH Have a per-bucket structure that contains all of these?
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * XXXMLG Document these structures.
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int magic;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int flags;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int chains;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int magic;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int magic;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int flags;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * dns_adbnamehook_t
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * This is a small widget that dangles off a dns_adbname_t. It contains a
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * pointer to the address information about this host, and a link to the next
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose * namehook that will contain the next address this host has.
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int magic;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * dns_adbzoneinfo_t
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * This is a small widget that holds zone-specific information about an
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * address. Currently limited to lameness, but could just as easily be
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek * extended to other types of information about zones.
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int magic;
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * An address entry. It holds quite a bit of information about addresses,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * including edns state, rtt, and of course the address of the host.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny unsigned int magic;
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny unsigned int refcnt;
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny unsigned int flags;
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozek unsigned int srtt;
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose * Internal functions (and prototypes).
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline dns_adbname_t *new_adbname(dns_adb_t *, dns_name_t *);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void free_adbname(dns_adb_t *, dns_adbname_t **);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbnamehook_t *new_adbnamehook(dns_adb_t *,
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline void free_adbnamehook(dns_adb_t *, dns_adbnamehook_t **);
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline dns_adbzoneinfo_t *new_adbzoneinfo(dns_adb_t *, dns_name_t *);
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline void free_adbzoneinfo(dns_adb_t *, dns_adbzoneinfo_t **);
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline dns_adbentry_t *new_adbentry(dns_adb_t *);
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline void free_adbentry(dns_adb_t *, dns_adbentry_t **);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbfind_t *new_adbfind(dns_adb_t *);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void free_adbfind(dns_adb_t *, dns_adbfind_t **);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbaddrinfo_t *new_adbaddrinfo(dns_adb_t *,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbfetch_t *new_adbfetch(dns_adb_t *);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void free_adbfetch(dns_adb_t *, dns_adbfetch_t **);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbfetch6_t *new_adbfetch6(dns_adb_t *, dns_adbname_t *,
8ba8222afca3026fd67af08e224b1d9e848aceaaJakub Hrozekstatic inline void free_adbfetch6(dns_adb_t *, dns_adbfetch6_t **);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbname_t *find_name_and_lock(dns_adb_t *, dns_name_t *,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline dns_adbentry_t *find_entry_and_lock(dns_adb_t *,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic void print_namehook_list(FILE *, dns_adbname_t *);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic void print_find_list(FILE *, dns_adbname_t *);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic void print_fetch_list(FILE *, dns_adbname_t *);
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorcestatic inline void inc_adb_irefcnt(dns_adb_t *, isc_boolean_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void dec_adb_irefcnt(dns_adb_t *, isc_boolean_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void inc_adb_erefcnt(dns_adb_t *, isc_boolean_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void dec_adb_erefcnt(dns_adb_t *, isc_boolean_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void inc_entry_refcnt(dns_adb_t *, dns_adbentry_t *,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic inline void dec_entry_refcnt(dns_adb_t *, dns_adbentry_t *,
2c68b4a680e64d8e506794d5976367394133504bJan Zelenystatic inline void violate_locking_hierarchy(isc_mutex_t *, isc_mutex_t *);
2c68b4a680e64d8e506794d5976367394133504bJan Zelenystatic void clean_namehooks(dns_adb_t *, dns_adbnamehooklist_t *);
2c68b4a680e64d8e506794d5976367394133504bJan Zelenystatic void clean_finds_at_name(dns_adbname_t *, isc_eventtype_t,
2c68b4a680e64d8e506794d5976367394133504bJan Zeleny unsigned int);
2c68b4a680e64d8e506794d5976367394133504bJan Zelenystatic void check_expire_namehooks(dns_adbname_t *, isc_stdtime_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic void cancel_fetches_at_name(dns_adb_t *, dns_adbname_t *);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic isc_result_t dbfind_name(dns_adbname_t *, isc_stdtime_t,
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorcestatic isc_result_t fetch_name_v4(dns_adbname_t *, isc_stdtime_t);
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorcestatic isc_result_t fetch_name_aaaa(dns_adbname_t *, isc_stdtime_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zelenystatic isc_result_t fetch_name_a6(dns_adbname_t *, isc_stdtime_t,
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorcestatic void timer_cleanup(isc_task_t *, isc_event_t *);
aac3ca699a09090072ae4d68bdda8dec990ae393Sumit Bosestatic inline void link_name(dns_adb_t *, int, dns_adbname_t *);
aac3ca699a09090072ae4d68bdda8dec990ae393Sumit Bosestatic inline void unlink_name(dns_adb_t *, dns_adbname_t *);
aac3ca699a09090072ae4d68bdda8dec990ae393Sumit Bosestatic void kill_name(dns_adbname_t **, isc_eventtype_t);
aac3ca699a09090072ae4d68bdda8dec990ae393Sumit Bosestatic void fetch_callback_a6(isc_task_t *, isc_event_t *);
aac3ca699a09090072ae4d68bdda8dec990ae393Sumit Bosestatic isc_result_t dbfind_a6(dns_adbname_t *, isc_stdtime_t, isc_boolean_t);
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * MUST NOT overlap DNS_ADBFIND_* flags!
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FIND_EVENTSENT(h) (((h)->flags & FIND_EVENT_SENT) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FIND_EVENTFREED(h) (((h)->flags & FIND_EVENT_FREED) != 0)
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce#define NAME_DEAD(n) (((n)->flags & NAME_IS_DEAD) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NAME_NEEDSPOKE(n) (((n)->flags & NAME_NEEDS_POKE) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * To the name, address classes are all that really exist. If it has a
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * V6 address it doesn't care if it came from an A6 chain or an AAAA query.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NAME_HAS_ADDRS(n) (NAME_HAS_V4(n) || NAME_HAS_V6(n))
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * Fetches are broken out into A, AAAA, and A6 types. In some cases,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * however, it makes more sense to test for a particular class of fetches,
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * like V4 or V6 above.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NAME_FETCH_AAAA(n) ((n)->fetch_aaaa != NULL)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NAME_FETCH_A6(n) (!ISC_LIST_EMPTY((n)->fetches_a6))
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NAME_FETCH_V6(n) (NAME_FETCH_AAAA(n) || NAME_FETCH_A6(n))
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose#define NAME_FETCH(n) (NAME_FETCH_V4(n) || NAME_FETCH_V6(n))
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose * Was this fetch started using the hints database?
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose * Was this the initial fetch for the A6 record? If so, we might want to
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose * start AAAA queries if it fails.
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose#define FETCH_USEHINTS(f) (((f)->flags & FETCH_USE_HINTS) != 0)
99bac83188601c2b07e0b141aac7dc7d882b464aSumit Bose#define FETCH_FIRSTA6(f) (((f)->flags & FETCH_FIRST_A6) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * Find options and tests to see if there are addresses on the list.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FIND_WANTEVENT(fn) (((fn)->options & DNS_ADBFIND_WANTEVENT) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FIND_WANTEMPTYEVENT(fn) (((fn)->options & DNS_ADBFIND_EMPTYEVENT) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define FIND_HAS_ADDRS(fn) (!ISC_LIST_EMPTY((fn)->list))
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * These are currently used on simple unsigned ints, so they are
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny * not really associated with any particular type.
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define WANT_INET(x) (((x) & DNS_ADBFIND_INET) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define WANT_INET6(x) (((x) & DNS_ADBFIND_INET6) != 0)
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define EXPIRE_OK(exp, now) ((exp == INT_MAX) || (exp < now))
c0f9698cd951b7223f251ff2511c4b22a6e4ba60Jan Zeleny#define NCACHE_RESULT(r) ((r) == DNS_R_NCACHENXDOMAIN || \
static isc_result_t
int addr_bucket;
unsigned int findoptions;
#if !defined(ISC_PLATFORM_HAVEIPV6)
INSIST(0);
goto next;
goto fail;
goto fail;
next:
fail:
if (new_addresses_added) {
return (ISC_R_SUCCESS);
return (result);
int addr_bucket;
goto fail;
goto fail;
goto fail;
fail:
name = *n;
*n = NULL;
int bucket;
int bucket;
int addr_bucket;
unsigned int addrs)
unsigned int wanted;
switch (evtype) {
if (wanted == 0) {
if (process) {
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->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 isc_result_t
goto cleanup;
goto cleanup;
static inline dns_adbfetch6_t *
dns_adbfetch6_t *f;
if (f == NULL)
return (NULL);
f->magic = 0;
f->flags = 0;
goto err;
goto err;
err:
return (NULL);
dns_adbfetch6_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:
goto reset;
#ifdef DUMP_ADB_AFTER_CLEANING
return (ISC_R_NOMEMORY);
goto fail0a;
goto fail0b;
goto fail0c;
goto fail1;
for (i = 0 ; i < NBUCKETS ; i++) {
for (i = 0 ; i < NBUCKETS ; 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;
unsigned int query_pending;
query_pending = 0;
if (now == 0) {
return (result);
return (ISC_R_NOMEMORY);
goto out;
goto out;
adbname);
goto v6;
goto v6;
adbname);
goto v6;
v6:
adbname);
goto copy;
goto copy;
adbname);
goto copy;
copy:
if (want_event) {
out:
if (want_event) {
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 < NBUCKETS ; i++)
for (i = 0 ; i < NBUCKETS ; i++)
for (i = 0 ; i < NBUCKETS ; i++) {
for (i = 0 ; i < NBUCKETS ; i++) {
case AF_INET:
case AF_INET6:
for (i = 0 ; i < NBUCKETS ; i++)
for (i = 0 ; i < NBUCKETS ; i++)
const char *tmpp;
case AF_INET:
case AF_INET6:
isc_buffer_t b;
if (NAME_FETCH_A(n))
if (NAME_FETCH_AAAA(n))
static isc_result_t
switch (result) {
case DNS_R_GLUE:
case DNS_R_HINT:
case DNS_R_SUCCESS:
case DNS_R_NCACHENXDOMAIN:
case DNS_R_NCACHENXRRSET:
return (result);
static isc_result_t
switch (result) {
case DNS_R_GLUE:
case DNS_R_HINT:
case DNS_R_SUCCESS:
case DNS_R_NCACHENXDOMAIN:
case DNS_R_NCACHENXRRSET:
return (result);
int bucket;
unsigned int address_type;
(void)task;
address_type = 0;
if (decr_adbrefcnt)
goto out;
goto out;
out:
int bucket;
(void)task;
if (decr_adbrefcnt)
goto out;
name);
goto out;
goto out;
name);
goto out;
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);
static isc_result_t
goto cleanup;
goto cleanup;
if (use_hints)
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;
int bucket;