- Fix that internally, CNAMEs with NXDOMAIN have that as rcode.

git-svn-id: file:///svn/unbound/trunk@2478 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2011-08-22 12:11:54 +00:00
parent 17e5bba504
commit d265c02f69
3 changed files with 10 additions and 8 deletions

View file

@ -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.

View file

@ -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; i<msg->rep->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;
}

View file

@ -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;
}