*
* dns_rdataslab_fromrdataset() allocates space for a dns_slabheader object
* and the memory needed for a raw slab, and partially initializes
- * it, setting the type, trust, and TTL fields to match rdataset->type,
- * rdataset->covers, rdataset->trust, and rdataset->ttl. (Note that the
- * last field needs to be overridden when used in the cache database,
- * since cache headers use an expire time instead of a TTL.)
+ * it, setting the type, and trust fields to match rdataset->type,
+ * rdataset->covers, and rdataset->trust.
*
* Requires:
*\li 'rdataset' is valid.
dns_slabheader_reset(newheader, node);
/*
- * By default, dns_rdataslab_fromrdataset() sets newheader->ttl
- * to the rdataset TTL. In the case of the cache, that's wrong;
- * we need it to be set to the expire time instead.
+ * Set the correct expire time.
*/
- setttl(newheader, rdataset->ttl + now);
+ setttl(newheader, now + rdataset->ttl);
if (rdataset->ttl == 0U) {
DNS_SLABHEADER_SETATTR(newheader, DNS_SLABHEADERATTR_ZEROTTL);
}
*header = (dns_slabheader_t){
.headers_link = CDS_LIST_HEAD_INIT(header->headers_link),
.trust = rdataset->trust,
- .expire = rdataset->ttl,
.dirtylink = ISC_LINK_INITIALIZER,
.nitems = nitems,
};