]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Make IPv6 DNSSEC tracing work, and revert to previous behaviour otherwise 245/head
authorPaul Radford <51978854+paul-internetnz@users.noreply.github.com>
Thu, 1 Aug 2024 05:04:11 +0000 (17:04 +1200)
committerGitHub <noreply@github.com>
Thu, 1 Aug 2024 05:04:11 +0000 (17:04 +1200)
If drill is executed without "-6", the previous behavior continues, with only A records being used.

drill/securetrace.c

index 90014b4e30075a2c69c015fdf177e6710d9796f7..dcd5c7739f4495fb0396616caea5b9d1e53d15e3 100644 (file)
@@ -291,7 +291,12 @@ do_secure_trace(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
                                /* trust glue? */
                                new_ns_addr = NULL;
                                if (ldns_dname_is_subdomain(pop, labels[i])) {
-                                       new_ns_addr = ldns_pkt_rr_list_by_name_and_type(local_p, pop, LDNS_RR_TYPE_A, LDNS_SECTION_ADDITIONAL);
+                                       if (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6) {
+                                               new_ns_addr = ldns_pkt_rr_list_by_name_and_type(local_p, pop, LDNS_RR_TYPE_AAAA, LDNS_SECTION_ADDITIONAL);
+                                       } else {
+                                               /* If IPv4 is specified, or no IP version is specified, default to A record and use IPv4 */
+                                               new_ns_addr = ldns_pkt_rr_list_by_name_and_type(local_p, pop, LDNS_RR_TYPE_A, LDNS_SECTION_ADDITIONAL);
+                                       }
                                }
                                if (!new_ns_addr || ldns_rr_list_rr_count(new_ns_addr) == 0) {
                                        new_ns_addr = ldns_get_rr_list_addr_by_name(res, pop, c, 0);