BUG/MINOR: tcpcheck: Don't warn on unused rules if check option is after
When tcp-check or http-check rules are used, if the corresponding check option
(option tcp-check and option httpchk) is declared after the ruleset, a warning
is emitted about an unused check ruleset while there is no problem in reality.
This patch must be backported as far as 2.2.
(cherry picked from commit c751b4508d9245baa54a19f7658aa7307d76e447)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/check.c b/src/check.c
index 0203e3e..63869b9 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1599,6 +1599,7 @@
free_tcpcheck_vars(&rules->preset_vars);
rules->list = &rs->rules;
rules->flags |= TCPCHK_RULES_TCP_CHK;
+ rules->flags &= ~TCPCHK_RULES_UNUSED_TCP_RS;
out:
return err_code;
@@ -2621,6 +2622,7 @@
rules->list = &rs->rules;
rules->flags |= TCPCHK_RULES_HTTP_CHK;
+ rules->flags &= ~TCPCHK_RULES_UNUSED_HTTP_RS;
if (!tcpcheck_add_http_rule(chk, rules, &errmsg)) {
ha_alert("parsing [%s:%d] : '%s %s' : %s.\n", file, line, args[0], args[1], errmsg);
rules->list = NULL;