diff --git a/bin/tests/adb_test.c b/bin/tests/adb_test.c index 27927b02c8..803c516af0 100644 --- a/bin/tests/adb_test.c +++ b/bin/tests/adb_test.c @@ -66,7 +66,6 @@ isc_result_t ns_rootns_init(void); void create_managers(void); static void lookup_callback(isc_task_t *, isc_event_t *); void create_view(void); -void destroy_view(void); client_t *new_client(void); void free_client(client_t **); static inline void CLOCK(void); @@ -294,11 +293,6 @@ create_view(void) dns_view_freeze(view); } -void -destroy_view(void) -{ - dns_view_detach(&view); -} void insert(char *target, char *addr, dns_ttl_t ttl, isc_stdtime_t now) @@ -465,7 +459,7 @@ main(int argc, char **argv) dns_adb_dump(adb, stderr); dns_adb_detach(&adb); - destroy_view(); + dns_view_detach(&view); isc_socketmgr_destroy(&socketmgr); isc_timermgr_destroy(&timermgr); diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 4d87da2de1..a37b482988 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -52,7 +52,7 @@ #include "../isc/util.h" -#if 1 +#if 0 #define DP(x) printf x #else #define DP(x) @@ -864,6 +864,7 @@ new_adbhandle(dns_adb_t *adb) h->query_pending = ISC_FALSE; h->partial_result = ISC_FALSE; h->result = ISC_R_UNEXPECTED; + ISC_LINK_INIT(h, plink); ISC_LIST_INIT(h->list); h->name_bucket = DNS_ADB_INVALIDBUCKET; h->adbname = NULL; @@ -959,6 +960,7 @@ free_adbhandle(dns_adb_t *adb, dns_adbhandle_t **handlep) *handlep = NULL; INSIST(ISC_LIST_EMPTY(handle->list)); + INSIST(!ISC_LINK_LINKED(handle, plink)); INSIST(!ISC_LINK_LINKED(handle, link)); INSIST(handle->name_bucket == DNS_ADB_INVALIDBUCKET); INSIST(handle->adbname == NULL); diff --git a/lib/dns/include/dns/adb.h b/lib/dns/include/dns/adb.h index a0aa54b32a..544892d230 100644 --- a/lib/dns/include/dns/adb.h +++ b/lib/dns/include/dns/adb.h @@ -122,6 +122,7 @@ struct dns_adbhandle { isc_boolean_t query_pending; /* RO: partial list */ isc_boolean_t partial_result; /* RO: addrs missing */ isc_result_t result; /* RO: extra result */ + ISC_LINK(dns_adbhandle_t) plink; /* RW: client use */ /* Private */ isc_mutex_t lock; /* locks all below */