More --filter-AAAA caching improvements.

Cache answers before filtering and filter coming out of the cache.
This commit is contained in:
Simon Kelley
2023-03-20 17:14:17 +00:00
parent 5a9eae429a
commit 2842972035
2 changed files with 38 additions and 19 deletions

View File

@@ -811,16 +811,6 @@ static size_t process_reply(struct dns_header *header, time_t now, struct server
}
}
/* Before extract_addresses() */
if (rcode == NOERROR)
{
if (option_bool(OPT_FILTER_A))
n = rrfilter(header, n, RRFILTER_A);
if (option_bool(OPT_FILTER_AAAA))
n = rrfilter(header, n, RRFILTER_AAAA);
}
switch (extract_addresses(header, n, daemon->namebuff, now, ipsets, nftsets, is_sign, check_rebind, no_cache, cache_secure, &doctored))
{
case 1:
@@ -839,6 +829,15 @@ static size_t process_reply(struct dns_header *header, time_t now, struct server
break;
}
if (rcode == NOERROR)
{
if (option_bool(OPT_FILTER_A))
n = rrfilter(header, n, RRFILTER_A);
if (option_bool(OPT_FILTER_AAAA))
n = rrfilter(header, n, RRFILTER_AAAA);
}
if (doctored)
cache_secure = 0;
}