From 1e49abc9195264b2ea9f2bd062b78a8a730207d4 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 5 Jan 2021 13:38:38 +0100 Subject: [PATCH] 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 --- src/dnsmasq_interface.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/dnsmasq_interface.c b/src/dnsmasq_interface.c index cf54a3c5..45d15c1c 100644 --- a/src/dnsmasq_interface.c +++ b/src/dnsmasq_interface.c @@ -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);