BUG/MINOR: server: Use the configured address family for the initial resolution
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Dec 2023 11:21:57 +0000 (12:21 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Dec 2023 11:21:59 +0000 (12:21 +0100)
commit3811c1de25bd8b05fb4684614883a0f04f304978
treec8757fec0f88b1fec5e5aa0aae7280b279180b42
parentd2540b2f720ca3fe909a56ef3ab532127a90b421
BUG/MINOR: server: Use the configured address family for the initial resolution

A regression was introduced by the commit c886fb58eb ("MINOR: server/ip:
centralize server ip updates"). The configured address family is lost when the
server address is initialized during the startup, for the resolution based on
the libc or based on the server state-file. Thus, "ipv4@" and "ipv6@" prefixed
are ignored.

To fix the bug, we take care to use the configured address family before calling
str2ip2() in srv_apply_lastaddr() and srv_apply_via_libc() functions.

This patch should fix the issue #2393. It must be backported to 2.9.
src/server.c