*
* How this beast works:
*
- * When a dns message is received in a buffer, dns_message_fromwire() is called
+ * When a dns message is received in a buffer, dns_message_parse() is called
* on the memory region. Various items are checked including the format
* of the message (if counts are right, if counts consume the entire sections,
* and if sections consume the entire message) and known pseudo-RRs in the
free_acachearray(mctx, rdataset, rdataset->additional_auth);
free_acachearray(mctx, rdataset, rdataset->additional_glue);
- if ((rdataset->attributes & RDATASET_ATTR_NONEXISTENT) != 0)
+ if (NONEXISTENT(rdataset))
size = sizeof(*rdataset);
else
size = dns_rdataslab_size((unsigned char *)rdataset,
/*
* We're adding a negative cache entry.
*/
- for (topheader = rbtnode->data;
- topheader != NULL;
- topheader = topheader->next) {
+ if (covers == dns_rdatatype_any) {
/*
* If we're adding an negative cache entry
* which covers all types (NXDOMAIN,
- * NODATA(QTYPE=ANY)).
+ * NODATA(QTYPE=ANY)),
*
* We make all other data stale so that the
* only rdataset that can be found at this
* node is the negative cache entry.
- *
- * Otherwise look for any RRSIGs of the
- * given type so they can be marked stale
- * later.
*/
- if (covers == dns_rdatatype_any) {
+ for (topheader = rbtnode->data;
+ topheader != NULL;
+ topheader = topheader->next)
+ {
set_ttl(rbtdb, topheader, 0);
mark_stale_header(rbtdb, topheader);
- } else if (topheader->type == sigtype)
- sigheader = topheader;
- }
- if (covers == dns_rdatatype_any)
+ }
goto find_header;
+ }
+ /*
+ * Otherwise look for any RRSIGs of the given
+ * type so they can be marked stale later.
+ */
+ for (topheader = rbtnode->data;
+ topheader != NULL;
+ topheader = topheader->next)
+ if (topheader->type == sigtype)
+ sigheader = topheader;
negtype = RBTDB_RDATATYPE_VALUE(covers, 0);
} else {
/*
* ANY and RRSIG queries for 0 TTL
* rdatasets to work.
*/
- if ((header->attributes &
- RDATASET_ATTR_NONEXISTENT) != 0 ||
+ if (NONEXISTENT(header) ||
(now != 0 && now > header->rdh_ttl))
header = NULL;
break;