Commit 11e89b9b authored by Michael Graff's avatar Michael Graff
Browse files

update the right ttl in a/aaaa db lookups. Print ttl in seconds from now,...

update the right ttl in a/aaaa db lookups.  Print ttl in seconds from now, rather than absolute time.
parent 499371d1
......@@ -435,7 +435,12 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
if (addr_bucket != DNS_ADB_INVALIDBUCKET)
adbname->expire_v4 = ISC_MIN(adbname->expire_v4, now + rdataset->ttl);
if (rdtype == dns_rdatatype_a)
adbname->expire_v4 = ISC_MIN(adbname->expire_v4,
now + rdataset->ttl);
adbname->expire_v6 = ISC_MIN(adbname->expire_v6,
now + rdataset->ttl);
* Lie a little here. This is more or less so code that cares
......@@ -681,8 +686,6 @@ shutdown_names(dns_adb_t *adb)
/* dump_adb(adb, stderr); */
......@@ -2518,6 +2521,11 @@ dump_adb(dns_adb_t *adb, FILE *f)
dns_adbentry_t *entry;
char tmp[512];
const char *tmpp;
isc_stdtime_t now;
isc_result_t result;
result = isc_stdtime_get(&now);
fprintf(f, "ADB %p DUMP:\n", adb);
fprintf(f, "erefcnt %u, irefcnt %u, finds out %u\n",
......@@ -2542,8 +2550,15 @@ dump_adb(dns_adb_t *adb, FILE *f)
fprintf(f, "name %p\n", name);
fprintf(f, "\tMAGIC %08x\n", name->magic);
fprintf(f, "\texpiry [%u %u] ",
name->expire_v4, name->expire_v6);
fprintf(f, "\texpiry [");
if (name->expire_v4 == INT_MAX)
fprintf(f, "inf ");
fprintf(f, "%d ", name->expire_v4 - now);
if (name->expire_v6 == INT_MAX)
fprintf(f, "inf] ");
fprintf(f, "%d] ", name->expire_v6 - now);
print_dns_name(f, &name->name);
fprintf(f, "\n");
print_namehook_list(f, name);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment