]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix classification for QTYPE=CNAME queries when QNAME minimisation is enabled.
authorRalph Dolmans <ralph@nlnetlabs.nl>
Fri, 17 Aug 2018 12:48:47 +0000 (12:48 +0000)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Fri, 17 Aug 2018 12:48:47 +0000 (12:48 +0000)
git-svn-id: file:///svn/unbound/trunk@4858 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iterator.c

index 00b32be897deb05802d9f4031ff150f17224323b..6234bc512c498aebe12d7781392c20650967733c 100644 (file)
@@ -1,3 +1,7 @@
+17 August 2018: Ralph
+       - Fix classification for QTYPE=CNAME queries when QNAME minimisation is
+         enabled.
+
 17 August 2018: Wouter
        - Set libunbound to increase current, because the libunbound change
          to the event callback function signature.  That needs programs,
index 7a55980a9083650dee826a4def57a2dd56589bcf..cb20c1e7cbeac0c6d086c439a3d6e05837c47933 100644 (file)
@@ -2598,6 +2598,15 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                        /* DNAME to a subdomain loop; do not recurse */
                        type = RESPONSE_TYPE_ANSWER;
                }
+       } else if(type == RESPONSE_TYPE_CNAME &&
+               iq->qchase.qtype == LDNS_RR_TYPE_CNAME &&
+               iq->minimisation_state == MINIMISE_STATE &&
+               query_dname_compare(iq->qchase.qname, iq->qinfo_out.qname) == 0) {
+               /* The minimised query for full QTYPE and hidden QTYPE can be
+                * classified as CNAME response type, even when the original
+                * QTYPE=CNAME. This should be treated as answer response type.
+                */
+               type = RESPONSE_TYPE_ANSWER;
        }
 
        /* handle each of the type cases */