]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixup bug in response type calculation.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 16 Aug 2007 13:35:37 +0000 (13:35 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 16 Aug 2007 13:35:37 +0000 (13:35 +0000)
git-svn-id: file:///svn/unbound/trunk@527 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iter_resptype.c

index 4585c67e41271be71094cde6c18414ae55adcb1c..92001aa43755e9e99dcc21f1dcddf2288c6d45d5 100644 (file)
@@ -5,7 +5,12 @@
        - This makes a key-prime succeed in validator, with DS or DNSKEY as
          trust-anchor.
        - fixup canonical compare byfield routine, fix bug and also neater.
-       
+       - fixed iterator response type classification for queries of type
+         ANY and NS.
+         dig ANY gives sometimes NS rrset in AN and NS section, and parser
+         removes the NS section duplicate. dig NS gives sometimes the NS
+         in the answer section, as referral.
+
 15 August 2007: Wouter
        - crypto calls to verify signatures.
        - unit test for rrsig verification.
index fc2d7031b48e4cb6f835f8ebfd9e2c17790cfadf..94e98a5a3240517512afe15cd13a02914f45ae6d 100644 (file)
@@ -138,6 +138,18 @@ response_type_from_server(struct dns_msg* msg, struct query_info* request,
                for(i=0; i<msg->rep->an_numrrsets; i++) {
                        struct ub_packed_rrset_key* s = msg->rep->rrsets[i];
                        
+                       /* if the answer section has NS rrset, and qtype ANY 
+                        * and the delegation is lower, and no CNAMEs followed,
+                        * this is a referral where the NS went to AN section */
+                       if((request->qtype == LDNS_RR_TYPE_ANY ||
+                               request->qtype == LDNS_RR_TYPE_NS) &&
+                               ntohs(s->rk.type) == LDNS_RR_TYPE_NS &&
+                               ntohs(s->rk.rrset_class) == request->qclass &&
+                               dname_strict_subdomain_c(s->rk.dname, 
+                               origzone)) {
+                               return RESPONSE_TYPE_REFERRAL;
+                       }
+
                        /* If we have encountered an answer (before or 
                         * after a CNAME), then we are done! Note that 
                         * if qtype == CNAME then this will be noted as an