BUG/MINOR: tcpcheck: fix incorrect list usage resulting in failure to load certain...
authorWilly Tarreau <w@1wt.eu>
Tue, 8 Mar 2016 14:20:25 +0000 (15:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 Mar 2016 14:20:25 +0000 (15:20 +0100)
commit1a786d7f33267efbbd352b8fb0442f215ee97cfd
tree11b00f3a850f456ed351077357c25863cedd9da0
parent78f3595f4d31e3b1d662a5c023887ac8e3182585
BUG/MINOR: tcpcheck: fix incorrect list usage resulting in failure to load certain configs

Commit baf9794 ("BUG/MINOR: tcpcheck: conf parsing error when no port
configured on server and first rule(s) is (are) COMMENT") was wrong, it
incorrectly implemented a list access by dereferencing a pointer of an
incorrect type resulting in checking the next element in the list. The
consequence is that it stops before the last comment instead of at the
last one and skips the first rule. In the end, rules starting with
comments are not affected, but if a sequence of checks directly starts
with connect, it is then skipped and this is visible when no port is
configured on the server line as the config refuses to load.

There was another occurence of the same bug a few lines below, both
of them were fixed. Tests were made on different configs and confirm
the new fix is OK.

This fix must be backported to 1.6.
src/server.c