]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that internally, CNAMEs with NXDOMAIN have that as rcode.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 22 Aug 2011 12:11:54 +0000 (12:11 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 22 Aug 2011 12:11:54 +0000 (12:11 +0000)
git-svn-id: file:///svn/unbound/trunk@2478 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iter_resptype.c
iterator/iter_scrub.c

index 676eb4d587f08c9d17a9e90f9de0155d843665ee..21e10cd4af1121aa4e7a063b3b650da0183aba28 100644 (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.
index 3137411743fb052cfd332852dc998b9c4af19e61..8ff7e3e6f85a134a355050bf4edef278de3f55b6 100644 (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;
        }
        
index b6cc16ce6162768741525de80550925646413b43..b0d137b527430e7847b7b6a7641ed6d098f13d9d 100644 (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;
                }