]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tcpcheck: Don't warn on unused rules if check option is after
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Nov 2020 07:55:57 +0000 (08:55 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Nov 2020 15:26:10 +0000 (16:26 +0100)
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.

src/check.c

index 0203e3ec98a87b9e37657fd9399d9233984982b6..63869b9d40c1e90ba89d631444c01a1614930f1f 100644 (file)
@@ -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;