BUG/MINOR: peers: peer synchronization issue (with several peers sections).
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 13 Jul 2017 07:07:09 +0000 (09:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Jul 2017 07:39:29 +0000 (09:39 +0200)
commited2b4a6b793d062000518e51ed71e014c649c313
tree98cbca572f886621aafe89f6a5f558db61b47418
parent7784f1739c740ff5a9958906bf5ddd1d75b36f60
BUG/MINOR: peers: peer synchronization issue (with several peers sections).

When several stick-tables were configured with several peers sections,
only a part of them could be synchronized: the ones attached to the last
parsed 'peers' section. This was due to the fact that, at least, the peer I/O handler
refered to the wrong peer section list, in fact always the same: the last one parsed.

The fact that the global peer section list was named "struct peers *peers"
lead to this issue. This variable name is dangerous ;).

So this patch renames global 'peers' variable to 'cfg_peers' to ensure that
no such wrong references are still in use, then all the functions wich used
old 'peers' variable have been modified to refer to the correct peer list.

Must be backported to 1.6 and 1.7.
include/types/peers.h
src/cfgparse.c
src/haproxy.c
src/peers.c
src/proxy.c