mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 23:00:00 -04:00
checkpoint
This commit is contained in:
parent
86246c7431
commit
23766ff690
6 changed files with 17 additions and 54 deletions
|
|
@ -258,7 +258,7 @@ lookup(const char *target) {
|
|||
result = dns_adb_createfind(adb, t2, lookup_callback, client,
|
||||
&client->name, dns_rootname, 0, options,
|
||||
now, NULL, view->dstport, 0, NULL,
|
||||
NULL, 0, &client->find);
|
||||
&client->find);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
printf("DNS_ADB_CREATEFIND -> %s\n", dns_result_totext(result));
|
||||
dns_adb_dumpfind(client->find, stderr);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ do_find(bool want_event) {
|
|||
dns_fixedname_name(&fixed),
|
||||
dns_rootname, 0, options, 0,
|
||||
dns_fixedname_name(&target), 0,
|
||||
0, NULL, NULL, 0, &find);
|
||||
0, NULL, &find);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (!ISC_LIST_EMPTY(find->list)) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -195,8 +195,6 @@ struct dns_adbname {
|
|||
isc_stdtime_t last_used;
|
||||
|
||||
ISC_LINK(dns_adbname_t) plink;
|
||||
isc_sockaddr_t client;
|
||||
dns_messageid_t id;
|
||||
};
|
||||
|
||||
/*% The adbfetch structure */
|
||||
|
|
@ -339,8 +337,7 @@ static isc_result_t dbfind_name(dns_adbname_t *, isc_stdtime_t,
|
|||
dns_rdatatype_t);
|
||||
static isc_result_t fetch_name(dns_adbname_t *, bool,
|
||||
unsigned int, isc_counter_t *qc,
|
||||
dns_rdatatype_t, const isc_sockaddr_t *client,
|
||||
dns_messageid_t id);
|
||||
dns_rdatatype_t);
|
||||
static inline void check_exit(dns_adb_t *);
|
||||
static void destroy(dns_adb_t *);
|
||||
static bool shutdown_names(dns_adb_t *);
|
||||
|
|
@ -1542,8 +1539,6 @@ clean_finds_at_name(dns_adbname_t *name, isc_eventtype_t evtype,
|
|||
|
||||
isc_task_sendanddetach(&task, (isc_event_t **)&ev);
|
||||
find->flags |= FIND_EVENT_SENT;
|
||||
memset(&name->client, 0, sizeof(name->client));
|
||||
name->id = 0;
|
||||
} else {
|
||||
DP(DEF_LEVEL, "cfan: skipping find %p", find);
|
||||
}
|
||||
|
|
@ -1700,9 +1695,6 @@ new_adbname(dns_adb_t *adb, const dns_name_t *dnsname) {
|
|||
name->fetch_aaaa = NULL;
|
||||
name->fetch_err = FIND_ERR_UNEXPECTED;
|
||||
name->fetch6_err = FIND_ERR_UNEXPECTED;
|
||||
memset(&name->client, 0, sizeof(name->client));
|
||||
name->id = 0;
|
||||
name->client.length = 0;
|
||||
ISC_LIST_INIT(name->finds);
|
||||
ISC_LINK_INIT(name, plink);
|
||||
|
||||
|
|
@ -2943,7 +2935,6 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
dns_rdatatype_t qtype, unsigned int options,
|
||||
isc_stdtime_t now, dns_name_t *target,
|
||||
in_port_t port, unsigned int depth, isc_counter_t *qc,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
dns_adbfind_t **findp)
|
||||
{
|
||||
dns_adbfind_t *find;
|
||||
|
|
@ -3034,19 +3025,6 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (adbname != NULL && client != NULL &&
|
||||
isc_sockaddr_equal(client, &adbname->client) && id == adbname->id) {
|
||||
char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE];
|
||||
char typebuf[DNS_RDATATYPE_FORMATSIZE];
|
||||
dns_name_format(qname, buf, sizeof(buf));
|
||||
dns_rdatatype_format(qtype, typebuf, sizeof(typebuf));
|
||||
result = DNS_R_DUPLICATE;
|
||||
DP(DEF_LEVEL,
|
||||
"dns_adb_createfind: duplicate query (possible loop) for %s/%s", buf, typebuf);
|
||||
RUNTIME_CHECK(!free_adbfind(adb, &find));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Nothing found. Allocate a new adbname structure for this name.
|
||||
*/
|
||||
|
|
@ -3196,7 +3174,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
*/
|
||||
if (WANT_INET(wanted_fetches) &&
|
||||
fetch_name(adbname, start_at_zone, depth, qc,
|
||||
dns_rdatatype_a, client, id) == ISC_R_SUCCESS) {
|
||||
dns_rdatatype_a) == ISC_R_SUCCESS) {
|
||||
DP(DEF_LEVEL, "dns_adb_createfind: "
|
||||
"started A fetch for name %s (%p)",
|
||||
namebuf, adbname);
|
||||
|
|
@ -3207,7 +3185,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
*/
|
||||
if (WANT_INET6(wanted_fetches) &&
|
||||
fetch_name(adbname, start_at_zone, depth, qc,
|
||||
dns_rdatatype_aaaa, client, id) == ISC_R_SUCCESS) {
|
||||
dns_rdatatype_aaaa) == ISC_R_SUCCESS) {
|
||||
DP(DEF_LEVEL, "dns_adb_createfind: "
|
||||
"started AAAA fetch for name %s (%p)",
|
||||
namebuf, adbname);
|
||||
|
|
@ -3243,19 +3221,13 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
find->adbname = adbname;
|
||||
find->name_bucket = bucket;
|
||||
bool empty = ISC_LIST_EMPTY(adbname->finds);
|
||||
/* If there are no finds pending take ownership of adbname */
|
||||
if (adbname->client.length == 0 && client != NULL) {
|
||||
adbname->client = *client;
|
||||
adbname->id = id;
|
||||
}
|
||||
ISC_LIST_APPEND(adbname->finds, find, plink);
|
||||
find->query_pending = (query_pending & wanted_addresses);
|
||||
find->flags &= ~DNS_ADBFIND_ADDRESSMASK;
|
||||
find->flags |= (find->query_pending & DNS_ADBFIND_ADDRESSMASK);
|
||||
DP(DEF_LEVEL, "createfind: attaching find %p to adbname "
|
||||
"%p (%d/%d) %d",
|
||||
find, adbname, isc_sockaddr_hash(&adbname->client, true),
|
||||
adbname->id, empty);
|
||||
"%p %d",
|
||||
find, adbname, empty);
|
||||
} else {
|
||||
/*
|
||||
* Remove the flag so the caller knows there will never
|
||||
|
|
@ -4022,8 +3994,7 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
|
|||
|
||||
static isc_result_t
|
||||
fetch_name(dns_adbname_t *adbname, bool start_at_zone,
|
||||
unsigned int depth, isc_counter_t *qc, dns_rdatatype_t type,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id)
|
||||
unsigned int depth, isc_counter_t *qc, dns_rdatatype_t type)
|
||||
{
|
||||
isc_result_t result;
|
||||
dns_adbfetch_t *fetch = NULL;
|
||||
|
|
@ -4078,7 +4049,7 @@ fetch_name(dns_adbname_t *adbname, bool start_at_zone,
|
|||
*/
|
||||
result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
|
||||
type, name, nameservers, NULL,
|
||||
client, id, options, depth, qc,
|
||||
NULL, 0, options, depth, qc,
|
||||
adb->task, fetch_callback, adbname,
|
||||
&fetch->rdataset, NULL,
|
||||
&fetch->fetch);
|
||||
|
|
|
|||
|
|
@ -337,7 +337,6 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
|
|||
dns_rdatatype_t qtype, unsigned int options,
|
||||
isc_stdtime_t now, dns_name_t *target, in_port_t port,
|
||||
unsigned int depth, isc_counter_t *qc,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
dns_adbfind_t **find);
|
||||
/*%<
|
||||
* Main interface for clients. The adb will look up the name given in
|
||||
|
|
|
|||
|
|
@ -3342,8 +3342,7 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
|
|||
&fctx->name, fctx->type,
|
||||
options, now, NULL,
|
||||
res->view->dstport,
|
||||
fctx->depth + 1, fctx->qc, fctx->client,
|
||||
fctx->id, &find);
|
||||
fctx->depth + 1, fctx->qc, &find);
|
||||
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
|
||||
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(3),
|
||||
"fctx %p(%s): createfind for %p/%d - %s",
|
||||
|
|
@ -3974,8 +3973,7 @@ fctx_try(fetchctx_t *fctx, bool retrying, bool badcache) {
|
|||
task = res->buckets[bucketnum].task;
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->qminname,
|
||||
fctx->qmintype, &fctx->domain,
|
||||
&fctx->nameservers, NULL,
|
||||
fctx->client, fctx->id,
|
||||
&fctx->nameservers, NULL, NULL, 0,
|
||||
options, 0, fctx->qc, task,
|
||||
resume_qmin, fctx,
|
||||
&fctx->qminrrset, NULL,
|
||||
|
|
@ -4576,6 +4574,7 @@ fctx_join(fetchctx_t *fctx, isc_task_t *task, const isc_sockaddr_t *client,
|
|||
else
|
||||
ISC_LIST_APPEND(fctx->events, event, ev_link);
|
||||
fctx->references++;
|
||||
fctx->client = client;
|
||||
|
||||
fetch->magic = DNS_FETCH_MAGIC;
|
||||
fetch->private = fctx;
|
||||
|
|
@ -4601,8 +4600,7 @@ static isc_result_t
|
|||
fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
unsigned int options, unsigned int bucketnum, unsigned int depth,
|
||||
isc_counter_t *qc, const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
fetchctx_t **fctxp)
|
||||
isc_counter_t *qc, fetchctx_t **fctxp)
|
||||
{
|
||||
fetchctx_t *fctx;
|
||||
isc_result_t result;
|
||||
|
|
@ -4722,8 +4720,6 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
|||
fctx->rand_bits = 0;
|
||||
fctx->timeout = false;
|
||||
fctx->addrinfo = NULL;
|
||||
fctx->client = client;
|
||||
fctx->id = id;
|
||||
fctx->ns_ttl = 0;
|
||||
fctx->ns_ttl_ok = false;
|
||||
|
||||
|
|
@ -7050,8 +7046,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
|
||||
dns_rdatatype_ns, domain,
|
||||
nsrdataset, NULL,
|
||||
fctx->client, fctx->id,
|
||||
nsrdataset, NULL, NULL, 0,
|
||||
fctx->options, 0, NULL, task,
|
||||
resume_dslookup, fctx,
|
||||
&fctx->nsrrset, NULL,
|
||||
|
|
@ -9325,8 +9320,7 @@ rctx_chaseds(respctx_t *rctx, dns_adbaddrinfo_t *addrinfo, isc_result_t result)
|
|||
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
|
||||
dns_rdatatype_ns,
|
||||
NULL, NULL, NULL,
|
||||
fctx->client, fctx->id,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
fctx->options, 0, NULL, rctx->task,
|
||||
resume_dslookup, fctx,
|
||||
&fctx->nsrrset, NULL,
|
||||
|
|
@ -10495,8 +10489,7 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
|
|||
|
||||
if (fctx == NULL) {
|
||||
result = fctx_create(res, name, type, domain, nameservers,
|
||||
options, bucketnum, depth, qc, client,
|
||||
id, &fctx);
|
||||
options, bucketnum, depth, qc, &fctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto unlock;
|
||||
new_fctx = true;
|
||||
|
|
|
|||
|
|
@ -10991,7 +10991,7 @@ notify_find_address(dns_notify_t *notify) {
|
|||
¬ify->ns, dns_rootname, 0,
|
||||
options, 0, NULL,
|
||||
notify->zone->view->dstport,
|
||||
0, NULL, NULL, 0, ¬ify->find);
|
||||
0, NULL, ¬ify->find);
|
||||
|
||||
/* Something failed? */
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue