]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: resolvers: break an infinite loop in resolv_get_ip_from_response()
authorWilly Tarreau <w@1wt.eu>
Fri, 3 Oct 2025 07:00:13 +0000 (09:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Oct 2025 07:08:10 +0000 (09:08 +0200)
commitced9784df482a5a476bef3e153e120efd7f78329
tree4ae3d59884e25d0e7f259b2d5b7c3c75e242790c
parentad75431b9c7eb739fa05f748098a9a505cf9c868
BUG/MEDIUM: resolvers: break an infinite loop in resolv_get_ip_from_response()

The fix in 3023e98199 ("BUG/MINOR: resolvers: Restore round-robin
selection on records in DNS answers") still contained an issue not
addressed f6dfbbe870 ("BUG/MEDIUM: resolvers: Test for empty tree
when getting a record from DNS answer"). Indeed, if the next element
is the same as the first one, then we can end up with an endless loop
because the test at the end compares the next pointer (possibly null)
with the end one (first).

Let's move the null->first transition at the end. This must be
backported where the patches above were backported (3.2 for now).
src/resolvers.c