chiark
/
gitweb
/
~mdw
/
adns
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed memory semantics of internal queries to fix bugs.
[adns]
/
src
/
reply.c
diff --git
a/src/reply.c
b/src/reply.c
index 452c5f69080ad4fe4822f7e82fafe4544322335b..fbc2c830cefa5ae8f9b1a48ac5a011dbd3d37256 100644
(file)
--- a/
src/reply.c
+++ b/
src/reply.c
@@
-156,7
+156,7
@@
void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
}
continue;
}
}
continue;
}
- if (rrtype == adns_r_cname &&
/* fixme - implement adns_qf_nocname */
+ if (rrtype == adns_r_cname &&
(qu->typei->type & adns__rrt_typemask) != adns_r_cname) {
if (qu->flags & adns_qf_cname_forbid) {
adns__query_fail(qu,adns_s_prohibitedcname);
(qu->typei->type & adns__rrt_typemask) != adns_r_cname) {
if (qu->flags & adns_qf_cname_forbid) {
adns__query_fail(qu,adns_s_prohibitedcname);
@@
-170,7
+170,7
@@
void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
if (!qu->vb.used) goto x_truncated;
if (st) { adns__query_fail(qu,st); return; }
l= strlen(qu->vb.buf)+1;
if (!qu->vb.used) goto x_truncated;
if (st) { adns__query_fail(qu,st); return; }
l= strlen(qu->vb.buf)+1;
- qu->answer->cname= adns__alloc_
interim
(qu,l);
+ qu->answer->cname= adns__alloc_
preserved
(qu,l);
if (!qu->answer->cname) { adns__query_fail(qu,adns_s_nomemory); return; }
qu->cname_dgram= adns__alloc_mine(qu,dglen);
if (!qu->answer->cname) { adns__query_fail(qu,adns_s_nomemory); return; }
qu->cname_dgram= adns__alloc_mine(qu,dglen);
@@
-227,7
+227,12
@@
void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
if (rcode == rcode_nxdomain) {
/* We still wanted to look for the SOA so we could find the TTL. */
adns__update_expires(qu,soattl,now);
if (rcode == rcode_nxdomain) {
/* We still wanted to look for the SOA so we could find the TTL. */
adns__update_expires(qu,soattl,now);
- adns__query_fail(qu,adns_s_nxdomain);
+
+ if (qu->flags & adns_qf_search) {
+ adns__search_next(ads,qu,now);
+ } else {
+ adns__query_fail(qu,adns_s_nxdomain);
+ }
return;
}
return;
}
@@
-302,7
+307,6
@@
void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
LIST_LINK_TAIL(ads->childw,qu);
return;
}
LIST_LINK_TAIL(ads->childw,qu);
return;
}
-
adns__query_done(qu);
return;
adns__query_done(qu);
return;
@@
-331,6
+335,6
@@
void adns__procdgram(adns_state ads, const byte *dgram, int dglen,
memcpy(newquery,qu->vb.buf,qu->vb.used);
}
memcpy(newquery,qu->vb.buf,qu->vb.used);
}
- adns__reset_
cnameonly
(qu);
+ adns__reset_
preserved
(qu);
adns__query_udp(qu,now);
}
adns__query_udp(qu,now);
}