diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index d35598bc2a..463ddaf08a 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -1657,15 +1657,6 @@ cname_and_other(qpznode_t *node, uint32_t serial) { for (header = node->data; header != NULL; header = header_next) { header_next = header->next; - if (!prio_type(header->type)) { - /* - * CNAME is in the priority list, so if we are done - * with priority types, we know there will not be a - * CNAME, and are safe to skip the rest. - */ - return false; - } - rdtype = DNS_TYPEPAIR_TYPE(header->type); if (rdtype == dns_rdatatype_cname) { do { @@ -1697,6 +1688,15 @@ cname_and_other(qpznode_t *node, uint32_t serial) { header = header->down; } while (header != NULL); if (header != NULL) { + if (!prio_type(header->type)) { + /* + * CNAME is in the priority list, so if + * we are done with priority types, we + * know there will not be a CNAME, and + * are safe to skip the rest. + */ + return cname; + } other = true; } } diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 53ba14b347..42fb550668 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -2418,14 +2418,6 @@ cname_and_other_data(dns_rbtnode_t *node, uint32_t serial) { */ for (header = node->data; header != NULL; header = header_next) { header_next = header->next; - if (!prio_type(header->type)) { - /* - * CNAME is in the priority list, so if we are done - * with the priority list, we know there will not be - * CNAME, so we are safe to skip the rest of the types. - */ - return false; - } if (header->type == dns_rdatatype_cname) { /* * Look for an active extant CNAME. @@ -2481,6 +2473,16 @@ cname_and_other_data(dns_rbtnode_t *node, uint32_t serial) { } } while (header != NULL); if (header != NULL) { + if (!prio_type(header->type)) { + /* + * CNAME is in the priority + * list, so if we are done with + * priority types, we know there + * will not be a CNAME, and are + * safe to skip the rest. + */ + return cname; + } other_data = true; } }