We cannot really decide whether local configuration lines are meant for blocking or something else. Just record such queries as replied to from cache because this is what they are. This code made sense at the time where wildcards were implemented as dnsmasq config lines, however, we've advanced to our own regex engine since then and all config lines should have also been auto-migrated.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-01-05 13:38:38 +01:00
parent ce02d73995
commit 1e49abc919
+4 -17
View File
@@ -1039,23 +1039,10 @@ void _FTL_reply(const unsigned int flags, const char *name, const union all_addr
// Get time index
const unsigned int timeidx = query->timeidx;
// Check whether this query was blocked
if(strcmp(answer, "(NXDOMAIN)") == 0 ||
strcmp(answer, "0.0.0.0") == 0 ||
strcmp(answer, "::") == 0)
{
// Mark query as blocked
clientsData* client = getClient(query->clientID, true);
query_blocked(query, domain, client, QUERY_REGEX);
}
else
{
// Answered from a custom (user provided) cache file
counters->cached++;
overTime[timeidx].cached++;
query->status = QUERY_CACHE;
}
// Answered from a custom (user provided) cache file
counters->cached++;
overTime[timeidx].cached++;
query->status = QUERY_CACHE;
// Save reply type and update individual reply counters
save_reply_type(flags, addr, query, response);