BUG/MINOR: resolvers: Always attach server on matching record on resolution
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Jun 2021 13:16:48 +0000 (15:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Jun 2021 15:15:33 +0000 (17:15 +0200)
commitd7bb23490c1a71542c7e98b7c44d92df081c7e52
treea3bfebe2dcc2600dcff69c0eccc26f679df58e1a
parent47ee44fb71cf88f85bbfc0d0981b4d2798f1d3ca
BUG/MINOR: resolvers: Always attach server on matching record on resolution

On A/AAAA resolution, for a given server, if a record is matching, we must
always attach the server to this record. Before it was only done if the
server IP was not the same than the record one. However, it is a problem if
the server IP was not set for a previous resolution. From the libc during
startup for instance. In this case, the server IP is not updated and the
server is not attached to any record. It remains in this state while a
matching record is found in the DNS response. It is especially a problem
when the resolution is used for server-templates.

This bug was introduced by the commit bd78c912f ("MEDIUM: resolvers: add a
ref on server to the used A/AAAA answer item").

This patch should solve the issue #1305. It must be backported to all
versions containing the above commit.
src/resolvers.c