X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Freply.c;h=0ee134a4f9956b0a3067d56e358ee6e85105c58a;hb=8b3d55e3d8df616f6fa6d9089a9c9e567229e17b;hp=452c5f69080ad4fe4822f7e82fafe4544322335b;hpb=73dba56e1981d7fe721acf17d0cd91a4fed04850;p=adns.git diff --git a/src/reply.c b/src/reply.c index 452c5f6..0ee134a 100644 --- a/src/reply.c +++ b/src/reply.c @@ -156,7 +156,7 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, } 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); @@ -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; - 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); @@ -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); - 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; } @@ -331,6 +336,6 @@ void adns__procdgram(adns_state ads, const byte *dgram, int dglen, memcpy(newquery,qu->vb.buf,qu->vb.used); } - adns__reset_cnameonly(qu); + adns__reset_preserved(qu); adns__query_udp(qu,now); }