]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: peers: fix localpeer regression with 'bind+server' config style
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 17 Apr 2024 16:43:25 +0000 (18:43 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 18 Apr 2024 09:18:13 +0000 (11:18 +0200)
commitf51f438875a435da34aca75b5e7dd4cc97d7a095
tree9fbf41d4294f8747fb817444d6705f5afcf4b6bb
parent9b3a27f70c31ac95fc092c613f3881d1be60a705
BUG/MEDIUM: peers: fix localpeer regression with 'bind+server' config style

A dumb mistake was made in f6ae25858 ("MINOR: peers: rely on srv->addr
and remove peer->addr"). I completely overlooked the part where the bind
address settings are used as implicit server's address settings when the
peers are declared using the new bind+server config style (which is the
new recommended method to declare peers as it follows the same logic as
the one used in other proxy sections).

As such, the peers synchro fails to work between previous and new process
(localpeer mechanism) upon reload when declaring peers with way:

global
localpeer local

peers mypeers
bind 127.0.0.1:10001
server local

And one has to use the 'old' config style to make it work:

global
localpeer local

peers mypeers
peer local 127.0.0.1:10001

--

To fix the issue, let's explicitly set the server's addr:port
according to the bind's address settings (only the first listener is
considered) when local peer was declared using the 'bind+server' method.

No backport needed.
src/cfgparse.c