]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: peers: set the proxy's name to the peers section name
authorWilly Tarreau <w@1wt.eu>
Tue, 31 May 2022 07:10:19 +0000 (09:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 May 2022 07:10:19 +0000 (09:10 +0200)
commit356866accefd16458f0e3c335d1b784e24e86d2d
tree01791bf62815fd0f2ad263d8eb51b4f9a5dcf01e
parent50e77b2b8569a5a61a5dbeafc89bac7647f4bcdb
BUG/MINOR: peers: set the proxy's name to the peers section name

For some poor historical reasons, the name of a peers proxy used to be
set to the name of the local peer itself. That causes some confusion when
multiple sections are present because the same proxy name appears at
multiple places in "show peers", but since 2.5 where parsing errors include
the proxy name, a config like this one :

   peers foo
       server foobar blah

Would report this when the local peer name isn't "foobar":

   'server (null)/foobar' : invalid address: 'blah' in 'blah'

And this when it is foobar:

   'server foobar/foobar' : invalid address: 'blah' in 'blah'

This is wrong, confusing and not very practical. This commit addresses
all this by using the peers section's name when it's created. This now
allows to report messages such as:

   'server foo/foobar' : invalid address: 'blah' in 'blah'

Which make it clear that the section is called "foo" and the server
"foobar".

This may be backported to 2.5, though the patch may be simplified if
needed, by just adding the change at the output of init_peers_frontend().
src/cfgparse.c