Skip to content
Snippets Groups Projects
Commit 32b24348 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

layer/rrcache: refuse very short TTLs

prevents pointless caching of TTL={0,1} records
parent adb48979
Branches
Tags
No related merge requests found
......@@ -120,6 +120,9 @@ static int merge_cache_rr(knot_rrset_t *cache_rr, const knot_rrset_t *rr, mm_ctx
if (rr->type != cache_rr->type || !knot_dname_is_equal(rr->owner, cache_rr->owner)) {
return KNOT_EOK; /* Ignore */
}
if (knot_rrset_ttl(rr) < 2) {
return KNOT_EINVAL; /* Cache busters */
}
return knot_rdataset_merge(&cache_rr->rrs, &rr->rrs, pool);
}
......
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