ns.asis.org.nz
ns.bouquets.co.nz
agate.co.nz
-adns debug: reply not found, id 313c, query owner security.gen.nz (NS=195.224.55.129)
-adns debug: reply not found, id 313d, query owner ns.tetra.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 313e, query owner mail.tetra.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 313f, query owner ns.securicard.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3140, query owner ns.underhour.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3141, query owner bcc.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3142, query owner security.org.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3143, query owner burglaralarms.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3144, query owner ns.safes.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3145, query owner ns.security.org.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3146, query owner couperconsulting.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3147, query owner securityguards.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3148, query owner ns.guards.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3149, query owner asis.org.nz (NS=195.224.55.129)
-adns debug: reply not found, id 314a, query owner neru.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 314b, query owner giftbasket.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 314c, query owner magic.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 314d, query owner mail.bcc.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 314e, query owner ns.investigation.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 314f, query owner nzipi.org.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3150, query owner ns.bouquet.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3151, query owner mail.safes.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3152, query owner ns.bcc.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3153, query owner ns.burglaralarms.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 3154, query owner ns.securityguards.co.nz (NS=195.224.55.129)
-adns debug: reply not found, id 318c, query owner agate.co.nz (NS=195.224.55.129)
254.0.99.203.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=80790
254.0.99.203.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
254.0.99.203.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
254.0.99.203.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
254.0.99.203.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
254.0.99.203.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
-adns debug: reply not found, id 313c, query owner security.gen.nz (NS=172.18.45.6)
-adns debug: reply not found, id 313d, query owner ns.tetra.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 313e, query owner mail.tetra.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 313f, query owner ns.securicard.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3140, query owner ns.underhour.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3141, query owner bcc.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3142, query owner security.org.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3143, query owner burglaralarms.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3144, query owner ns.safes.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3145, query owner ns.security.org.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3146, query owner couperconsulting.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3147, query owner securityguards.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3148, query owner ns.guards.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3149, query owner asis.org.nz (NS=172.18.45.6)
-adns debug: reply not found, id 314a, query owner neru.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 314b, query owner giftbasket.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 314c, query owner magic.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 314d, query owner mail.bcc.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 314e, query owner ns.investigation.co.nz (NS=172.18.45.6)
-adns debug: reply not found, id 314f, query owner nzipi.org.nz (NS=172.18.45.6)
-adns debug: reply not found, id 3150, query owner ns.bouquet.co.nz (NS=172.18.45.6)
254.0.99.203.in-addr.arpa flags 292 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86351
adns debug: reply not found, id 3151, query owner mail.safes.co.nz (NS=172.18.45.6)
adns debug: reply not found, id 3152, query owner ns.bcc.co.nz (NS=172.18.45.6)
4.204.50.158.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
4.204.50.158.in-addr.arpa flags 0 type 65551 MX(+addr) submitted
4.204.50.158.in-addr.arpa flags 0 type 131078 SOA(822) submitted
-4.204.50.158.in-addr.arpa flags 0 type 131089adns debug: reply not found, id 3142, query owner ns2.afpdoc.com (NS=172.18.45.6)
-adns debug: reply not found, id 3143, query owner ns2.afp-notes.com (NS=172.18.45.6)
-adns debug: reply not found, id 3144, query owner ns2.afp-domino.com (NS=172.18.45.6)
- RP(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131089 RP(822) submitted
4.204.50.158.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
4.204.50.158.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
4.204.50.158.in-addr.arpa flags 0 type SOA(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
4.204.50.158.in-addr.arpa flags 0 type NS(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
4.204.50.158.in-addr.arpa flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
4.204.50.158.in-addr.arpa flags 0 type SOA(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
-4.204.50.158.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=77948
4.204.50.158.in-addr.arpa flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=77948
4.204.50.158.in-addr.arpa flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
rc=0
});
}
+static void checkc_query_done(adns_state ads, adns_query qu) {
+ assert(qu->state == query_done);
+ assert(!qu->children.head && !qu->children.tail);
+ checkc_query(ads,qu);
+}
+
static void checkc_queue_output(adns_state ads) {
adns_query qu;
DLIST_CHECK(ads->output, qu, , {
- assert(qu->state == query_done);
- assert(!qu->children.head && !qu->children.tail);
assert(!qu->parent);
assert(!qu->allocations.head && !qu->allocations.tail);
- checkc_query(ads,qu);
+ checkc_query_done(ads,qu);
+ });
+}
+
+static void checkc_queue_intdone(adns_state ads) {
+ adns_query qu;
+
+ DLIST_CHECK(ads->intdone, qu, , {
+ assert(qu->parent);
+ assert(qu->ctx.callback);
+ checkc_query_done(ads,qu);
});
}
break;
case cc_entex:
if (!(ads->iflags & adns_if_checkc_entex)) return;
+ assert(!ads->intdone.head);
break;
case cc_freq:
if ((ads->iflags & adns_if_checkc_freq) != adns_if_checkc_freq) return;
checkc_queue_tcpw(ads);
checkc_queue_childw(ads);
checkc_queue_output(ads);
+ checkc_queue_intdone(ads);
if (qu) {
switch (qu->state) {
DLIST_ASSERTON(qu, search, ads->childw, );
break;
case query_done:
- DLIST_ASSERTON(qu, search, ads->output, );
+ if (qu->parent)
+ DLIST_ASSERTON(qu, search, ads->intdone, );
+ else
+ DLIST_ASSERTON(qu, search, ads->output, );
break;
default:
assert(!"specific query state");
* Queries in state tcpw/tcpw have been sent (or are in the to-send buffer)
* iff the tcp connection is in state server_ok.
*
+ * Internal queries (from adns__submit_internal) end up on intdone
+ * instead of output, and the callbacks are made on the way out of
+ * adns, to avoid reentrancy hazards.
+ *
* +------------------------+
* START -----> | tosend/NONE |
* +------------------------+
adns_logcallbackfn *logfn;
void *logfndata;
int configerrno;
- struct query_queue udpw, tcpw, childw, output;
+ struct query_queue udpw, tcpw, childw, output, intdone;
adns_query forallnext;
int nextid, tcpsocket;
struct udpsocket { int af; int fd; } udpsocket[MAXUDP];
void adns__returning(adns_state ads, adns_query qu);
/* Must be called before returning from adns any time that we have
- * progressed (including made, finished or destroyed) queries. */
+ * progressed (including made, finished or destroyed) queries.
+ *
+ * Might reenter adns via internal query callbacks, so
+ * external-faciing functions which call adns__returning should
+ * normally be avoided in internal code. */
/* From reply.c: */
}
void adns__returning(adns_state ads, adns_query qu_for_caller) {
+ while (ads->intdone.head) {
+ adns_query iq= ads->intdone.head;
+ adns_query parent= iq->parent;
+ LIST_UNLINK_PART(parent->children,iq,siblings.);
+ LIST_UNLINK(iq->ads->childw,parent);
+ LIST_UNLINK(ads->intdone,iq);
+ iq->ctx.callback(parent,iq);
+ free_query_allocs(iq);
+ free(iq->answer);
+ free(iq);
+ }
adns__consistency(ads,qu_for_caller,cc_entex);
}
LIST_UNLINK(ads->childw,qu);
break;
case query_done:
- LIST_UNLINK(ads->output,qu);
+ if (qu->parent)
+ LIST_UNLINK(ads->intdone,qu);
+ else
+ LIST_UNLINK(ads->output,qu);
break;
default:
abort();
}
void adns__query_done(adns_query qu) {
+ adns_state ads=qu->ads;
adns_answer *ans;
- adns_query parent;
adns__cancel_children(qu);
}
ans->expires= qu->expires;
- parent= qu->parent;
- if (parent) {
- LIST_UNLINK_PART(parent->children,qu,siblings.);
- LIST_UNLINK(qu->ads->childw,parent);
- qu->ctx.callback(parent,qu);
- free_query_allocs(qu);
- free(qu->answer);
- free(qu);
+ qu->state= query_done;
+ if (qu->parent) {
+ LIST_LINK_TAIL(ads->intdone,qu);
} else {
makefinal_query(qu);
LIST_LINK_TAIL(qu->ads->output,qu);
- qu->state= query_done;
}
}
LIST_INIT(ads->tcpw);
LIST_INIT(ads->childw);
LIST_INIT(ads->output);
+ LIST_INIT(ads->intdone);
ads->forallnext= 0;
ads->nextid= 0x311f;
ads->nudp= 0;
else if (ads->tcpw.head) adns__cancel(ads->tcpw.head);
else if (ads->childw.head) adns__cancel(ads->childw.head);
else if (ads->output.head) adns__cancel(ads->output.head);
+ else if (ads->intdone.head) adns__cancel(ads->output.head);
else break;
}
for (i=0; i<ads->nudp; i++) close(ads->udpsocket[i].fd);