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.4-dev1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c751b4508d9245baa54a19f7658aa7307d76e447;p=thirdparty%2Fhaproxy.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. --- diff --git a/src/check.c b/src/check.c index 0203e3ec98..63869b9d40 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;