don't set rdh_ttl in init_rdataset

(cherry picked from commit def6608a44)
This commit is contained in:
Mark Andrews
2015-04-17 23:50:36 +10:00
parent 397ae92d8e
commit 5abfe27109
+7 -4
View File
@@ -852,12 +852,15 @@ set_ttl(dns_rbtdb_t *rbtdb, rdatasetheader_t *header, dns_ttl_t newttl) {
isc_heap_t *heap;
dns_ttl_t oldttl;
if (!IS_CACHE(rbtdb)) {
header->rdh_ttl = newttl;
return;
}
oldttl = header->rdh_ttl;
header->rdh_ttl = newttl;
if (!IS_CACHE(rbtdb))
return;
/*
* It's possible the rbtdb is not a cache. If this is the case,
* we will not have a heap, and we move on. If we do, though,
@@ -1362,7 +1365,6 @@ init_rdataset(dns_rbtdb_t *rbtdb, rdatasetheader_t *h)
{
ISC_LINK_INIT(h, link);
h->heap_index = 0;
h->rdh_ttl = 0;
#if TRACE_HEADER
if (IS_CACHE(rbtdb) && rbtdb->common.rdclass == dns_rdataclass_in)
@@ -1386,6 +1388,7 @@ new_rdataset(dns_rbtdb_t *rbtdb, isc_mem_t *mctx)
fprintf(stderr, "allocated header: %p\n", h);
#endif
init_rdataset(rbtdb, h);
h->rdh_ttl = 0;
return (h);
}