]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: resolvers: throw log message if trash not large enough for query
authorEmeric Brun <ebrun@haproxy.com>
Fri, 29 Oct 2021 14:44:49 +0000 (16:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Nov 2021 16:16:46 +0000 (17:16 +0100)
commit0161d32df2b602cd1571539cb8890a68518832a3
tree15d0a0f79a530d44bb107565ffe9ae6e9e00d04f
parentc37caab21c172ca042d5ef3aca6d1102f479dd53
BUG/MINOR: resolvers: throw log message if trash not large enough for query

Before this patch the sent error counter was increased
for each targeted nameserver as soon as we were unable to build
the query message into the trash buffer. But this counter is here
to count sent errors at dns.c transport layer and this error is not
related to a nameserver.

This patch stops to increase those counters and sent a log message
to signal the trash buffer size is not large enough to build the query.

Note: This case should not happen except if trash size buffer was
customized to a very low value.

The function was also re-worked to return -1 in this error case
as it was specified in comment. This function is currently
called at multiple point in resolver.c but return code
is still not yet handled. So to advert the user of the malfunction
the log message was added.

This patch should be backported on all versions including the
layer split between dns.c and resolver.c (v >= 2.4)
src/resolvers.c