BUG/MINOR: check: Don't perform any check on servers defined in a frontend
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 12 Jan 2021 16:29:45 +0000 (17:29 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Jan 2021 12:44:04 +0000 (13:44 +0100)
commit0a5e713b3263dd35c947389729aef43c02e21be4
treea6e74b76c266dc573a66068ae4b4c79d31ec087b
parent54c88770d37ce28077dd4a20b8ffbb54a56cca8b
BUG/MINOR: check: Don't perform any check on servers defined in a frontend

If a server is defined in a frontend, thus a proxy without the backend
capability, the 'check' and 'agent-check' keywords are ignored. This way, no
check is performed on an ignored server. This avoids a segfault because some
part of the tcpchecks are not fully initialized (or released for frontends
during the post-check).

In addition, an test on the server's proxy capabilities is performed when
checks or agent-checks are initialized and nothing is performed for servers
attached to a non-backend proxy.

This patch should fix the issue #1043. It must be backported as far as 2.2.

(cherry picked from commit 6ecd59326f7416dcba215f05a6674d4b9f970749)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/check.c