From: Wouter Wijngaards Date: Mon, 22 Aug 2011 12:11:54 +0000 (+0000) Subject: - Fix that internally, CNAMEs with NXDOMAIN have that as rcode. X-Git-Tag: release-1.4.13rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d265c02f69ec2bf83801025f9e1c07deab46c73a;p=thirdparty%2Funbound.git - Fix that internally, CNAMEs with NXDOMAIN have that as rcode. git-svn-id: file:///svn/unbound/trunk@2478 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 676eb4d58..21e10cd4a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ It does not test for completeness (i.e. with NSEC or NSEC3 query), and it does not follow the CNAME or DNAME to another name (with even more data for the already large response). + - Fix that internally, CNAMEs with NXDOMAIN have that as rcode. 18 August 2011: Wouter - fix autoconf call in makedist crosscompile to RC or snapshot. diff --git a/iterator/iter_resptype.c b/iterator/iter_resptype.c index 313741174..8ff7e3e6f 100644 --- a/iterator/iter_resptype.c +++ b/iterator/iter_resptype.c @@ -119,6 +119,15 @@ response_type_from_server(int rdset, if( (msg->rep->flags&BIT_RA) && !(msg->rep->flags&BIT_AA) && !rdset) return RESPONSE_TYPE_REC_LAME; + /* it could be a CNAME with NXDOMAIN rcode */ + for(i=0; irep->an_numrrsets; i++) { + s = msg->rep->rrsets[i]; + if(ntohs(s->rk.type) == LDNS_RR_TYPE_CNAME && + query_dname_compare(request->qname, + s->rk.dname) == 0) { + return RESPONSE_TYPE_CNAME; + } + } return RESPONSE_TYPE_ANSWER; } diff --git a/iterator/iter_scrub.c b/iterator/iter_scrub.c index b6cc16ce6..b0d137b52 100644 --- a/iterator/iter_scrub.c +++ b/iterator/iter_scrub.c @@ -363,10 +363,6 @@ scrub_normalize(ldns_buffer* pkt, struct msg_parse* msg, "too long"); return 0; } - /* internally we have CNAME'd/DNAME'd chains ending - * in nxdomain with NOERROR rcode, change rcode - * to reflect this (if needed) */ - FLAGS_SET_RCODE(msg->flags, LDNS_RCODE_NOERROR); if(nx && nx->type == LDNS_RR_TYPE_CNAME && dname_pkt_compare(pkt, sname, nx->dname) == 0) { /* check next cname */ @@ -420,10 +416,6 @@ scrub_normalize(ldns_buffer* pkt, struct msg_parse* msg, rrset = rrset->rrset_all_next; } } - /* internally we have CNAME'd/DNAME'd chains ending - * in nxdomain with NOERROR rcode, change rcode - * to reflect this (if needed) */ - FLAGS_SET_RCODE(msg->flags, LDNS_RCODE_NOERROR); continue; }