From: Christopher Faulet Date: Fri, 13 Nov 2020 07:55:57 +0000 (+0100) Subject: BUG/MINOR: tcpcheck: Don't warn on unused rules if check option is after X-Git-Tag: v2.3.1~8 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=e09b5a39238a86e470d198595002960d971c03cb;p=haproxy-2.3.git 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 --- 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 @@ int proxy_parse_tcp_check_opt(char **args, int cur_arg, struct proxy *curpx, str 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 @@ int proxy_parse_httpchk_opt(char **args, int cur_arg, struct proxy *curpx, struc 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;