[Dnsmasq-discuss] [PATCH] Log format error from upstream as 'FORMERR' [1/1]
Geert Stappers
stappers at stappers.nl
Tue Apr 22 20:41:35 UTC 2025
On Sun, Apr 20, 2025 at 06:42:30PM +0000, Rob Gill via Dnsmasq-discuss wrote:
> At the moment if a misformatted query is reported by the upstream server
> it is not clear from the log.
> Other error codes from RFC1035 (server failure, not implemented,
> refused) are logged with text, but format error is logged merely as "1".
>
> Such that an upstream reporting a format error is presently logged as eg:
> Apr 20 12:01:55 dnsmasq[3023]: reply error is 1
>
> After this patch they are logged informatively, eg:
> Apr 20 12:48:40 dnsmasq[3023]: reply error is FORMERR
>
> This is a two line fix, FORMERR is already defined in dns-protocol.h.
>
> ---------------------------
>
> Subject: [PATCH] Log format error from upstream as 'FORMERR'
>
> Signed-off-by: Rob Gill <rrobgill at protonmail.com>
> ---
> src/cache.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/cache.c b/src/cache.c
> index 94f19a5..3f9316a 100644
> --- a/src/cache.c
> +++ b/src/cache.c
> @@ -2218,6 +2218,8 @@ void log_query(unsigned int flags, char *name,
> union all_addr *addr, char *arg,
> dest = "SERVFAIL";
> else if (rcode == REFUSED)
> dest = "REFUSED";
> + else if (rcode == FORMERR)
> + dest = "FORMERR";
> else if (rcode == NOTIMP)
> dest = "not implemented";
> else
> --
> 2.25.1
>
Looks good.
And I think that after reading https://git-send-email.io/
a new attempt should be tried. If so, please CC
~stappers/dnsmasqmlpc at lists.sr.ht
Groeten
Geert Stappers
dnsmasq fanboy
--
Silence is hard to parse
More information about the Dnsmasq-discuss
mailing list