Don't waste time caching zero-TTL DNS records.

This commit is contained in:
Simon Kelley
2019-10-25 17:31:53 +01:00
parent 122997da54
commit 1292e1a557

View File

@@ -499,6 +499,13 @@ static struct crec *really_insert(char *name, union all_addr *addr, unsigned sho
/* if previous insertion failed give up now. */
if (insert_error)
return NULL;
/* we don't cache zero-TTL records. */
if (ttl == 0)
{
insert_error = 1;
return NULL;
}
/* First remove any expired entries and entries for the name/address we
are currently inserting. */