diff --git a/src/dnsmasq_interface.c b/src/dnsmasq_interface.c index 7285a399..f492ca0a 100644 --- a/src/dnsmasq_interface.c +++ b/src/dnsmasq_interface.c @@ -95,15 +95,18 @@ static struct { static union mysockaddr last_server = {{ 0 }}; unsigned char* pihole_privacylevel = &config.privacylevel; -const char *flagnames[] = {"F_IMMORTAL ", "F_NAMEP ", "F_REVERSE ", "F_FORWARD ", "F_DHCP ", "F_NEG ", "F_HOSTS ", "F_IPV4 ", "F_IPV6 ", "F_BIGNAME ", "F_NXDOMAIN ", "F_CNAME ", "F_DNSKEY ", "F_CONFIG ", "F_DS ", "F_DNSSECOK ", "F_UPSTREAM ", "F_RRNAME ", "F_SERVER ", "F_QUERY ", "F_NOERR ", "F_AUTH ", "F_RR ", "F_KEYTAG ", "F_SECSTAT ", "F_NO_RR ", "F_IPSET ", "F_NOEXTRA ", "F_SERVFAIL", "F_RCODE", "F_SRV", "F_STALE" }; +const char *flagnames[] = {"F_IMMORTAL ", "F_NAMEP ", "F_REVERSE ", "F_FORWARD ", "F_DHCP ", "F_NEG ", "F_HOSTS ", "F_IPV4 ", "F_IPV6 ", "F_BIGNAME ", "F_NXDOMAIN ", "F_CNAME ", "F_DNSKEY ", "F_CONFIG ", "F_DS ", "F_DNSSECOK ", "F_UPSTREAM ", "F_RRNAME ", "F_SERVER ", "F_QUERY ", "F_NOERR ", "F_AUTH ", "F_DNSSEC ", "F_KEYTAG ", "F_SECSTAT ", "F_NO_RR ", "F_IPSET ", "F_NOEXTRA ", "F_DOMAINSRV", "F_RCODE", "F_RR", "F_STALE" }; -void FTL_hook(unsigned int flags, const char *name, union all_addr *addr, char *arg, int id, unsigned short type, const char* file, const int line) +void FTL_hook(unsigned int flags, +const char *name, +union all_addr *addr, char *arg, int id, unsigned short type, const char* file, const int line) { // Extract filename from path const char *path = short_path(file); if(config.debug & DEBUG_FLAGS) { - logg("Processing FTL hook from %s:%d (name: \"%s\")...", path, line, name); + const char *types = flags & F_RR ? querystr(arg, type) : "?"; + logg("Processing FTL hook from %s:%d (type: %s, name: \"%s\", id: %i)...", path, line, types, name, id); print_flags(flags); } @@ -122,7 +125,7 @@ void FTL_hook(unsigned int flags, const char *name, union all_addr *addr, char * else if(flags & F_RCODE && name && strcasecmp(name, "error") == 0) // upstream sent something different than NOERROR or NXDOMAIN FTL_upstream_error(addr, flags, id, path, line); - else if(flags & F_NOEXTRA && flags & F_NOERR) + else if(flags & F_NOEXTRA && flags & F_DNSSEC) { // This is a new DNSSEC query (dnssec-query[DS]) if(!config.show_dnssec) diff --git a/test/test_suite.bats b/test/test_suite.bats index cc340ffb..3cb61dcc 100644 --- a/test/test_suite.bats +++ b/test/test_suite.bats @@ -459,14 +459,14 @@ [[ ${lines[14]} == "reply_CNAME 7" ]] [[ ${lines[15]} == "reply_IP 25" ]] [[ ${lines[16]} == "reply_DOMAIN 0" ]] - [[ ${lines[17]} == "reply_RRNAME 5" ]] + [[ ${lines[17]} == "reply_RRNAME 6" ]] [[ ${lines[18]} == "reply_SERVFAIL 0" ]] [[ ${lines[19]} == "reply_REFUSED 0" ]] [[ ${lines[20]} == "reply_NOTIMP 0" ]] [[ ${lines[21]} == "reply_OTHER 0" ]] [[ ${lines[22]} == "reply_DNSSEC 6" ]] [[ ${lines[23]} == "reply_NONE 0" ]] - [[ ${lines[24]} == "reply_BLOB 10" ]] + [[ ${lines[24]} == "reply_BLOB 9" ]] [[ ${lines[25]} == "dns_queries_all_replies 54" ]] [[ ${lines[26]} == "privacy_level 0" ]] [[ ${lines[27]} == "status enabled" ]] @@ -617,7 +617,7 @@ [[ ${lines[25]} == *" A use-application-dns.net 127.0.0.1 16 2 2 "*" N/A -1 N/A#0 \"\" \"24\""* ]] [[ ${lines[26]} == *" A a.ftl 127.0.0.1 3 2 4 "*" N/A -1 N/A#0 \"\" \"25\""* ]] [[ ${lines[27]} == *" AAAA aaaa.ftl 127.0.0.1 3 2 4 "*" N/A -1 N/A#0 \"\" \"26\""* ]] - [[ ${lines[28]} == *" ANY any.ftl 127.0.0.1 2 2 13 "*" N/A -1 127.0.0.1#5555 \"\" \"27\""* ]] + [[ ${lines[28]} == *" ANY any.ftl 127.0.0.1 2 2 6 "*" N/A -1 127.0.0.1#5555 \"\" \"27\""* ]] [[ ${lines[29]} == *" [CNAME] cname-ok.ftl 127.0.0.1 2 2 3 "*" N/A -1 127.0.0.1#5555 \"\" \"28\""* ]] [[ ${lines[30]} == *" SRV srv.ftl 127.0.0.1 2 2 13 "*" N/A -1 127.0.0.1#5555 \"\" \"29\""* ]] [[ ${lines[31]} == *" SOA ftl 127.0.0.1 2 2 13 "*" N/A -1 127.0.0.1#5555 \"\" \"30\""* ]]