]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
harvest CNAME.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 7 Mar 2008 10:38:24 +0000 (10:38 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 7 Mar 2008 10:38:24 +0000 (10:38 +0000)
git-svn-id: file:///svn/unbound/trunk@1017 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
testcode/harvest.c

index ea54822316a8a5f06ad3874df1bea2a267f615a2..a79724e4c0060c099ff8a3a4e8271e249a80d012 100644 (file)
@@ -1,5 +1,6 @@
 7 March 2008: Wouter
        - -C config feature for harvest program. 
+       - harvest handles CNAMEs too.
 
 5 March 2008: Wouter
        - patch from Hugo Koji Kobayashi for iterator logs spelling.
index 0f04730b65c6a8a593595b4389353688b865118c..cb073e573044dd63eaa19a0b88bdc7737b44244a 100644 (file)
@@ -390,6 +390,18 @@ process_rr(struct harvest_data* data, ldns_rr* rr, int depth)
        } else if(ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
                new_todo_infra(data, find_create_lab(data, 
                        ldns_rr_rdf(rr, 0)), depth+1);
+       } else if(ldns_rr_get_type(rr) == LDNS_RR_TYPE_CNAME) {
+               int t = ldns_rr_get_type(rr);
+               if(t!=LDNS_RR_TYPE_A && t!=LDNS_RR_TYPE_AAAA &&
+                       t!=LDNS_RR_TYPE_SOA && t!=LDNS_RR_TYPE_NS &&
+                       t!=LDNS_RR_TYPE_DS && t!=LDNS_RR_TYPE_DNSKEY)
+                       new_todo_item(data, ldns_rr_rdf(rr, 0), t,
+                               ldns_rr_get_class(rr), depth+1);
+                       /* can get caught in CNAME loop, but depth will
+                        * catch that; unbound cache helps too(servfails on
+                        * a cname loop) */
+               new_todo_infra(data, find_create_lab(data, 
+                       ldns_rr_rdf(rr, 0)), depth+1);
        }
        /* store it */
        if(ldns_rr_get_type(rr) == LDNS_RR_TYPE_NSEC) {