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 {
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;
}
}