From: Christopher Faulet Date: Fri, 25 Jun 2021 09:37:45 +0000 (+0200) Subject: BUG/MINOR: tcpcheck: Fix numbering of implicit HTTP send/expect rules X-Git-Tag: v2.3.11~19 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=2eafa55e72845bd7dbeb3bc117dd1fda0f54a775;p=haproxy-2.3.git BUG/MINOR: tcpcheck: Fix numbering of implicit HTTP send/expect rules The index of the failing rule is reported in the health-check log message. The rules index is also used in the check traces. But for implicit HTTP send/expect rules, the index is wrong. It must be incremented by one compared to the preceding rule. This patch may be backported as far as 2.2. (cherry picked from commit fa5880bd539b9069fd1b139d32cffae2bb3c2c3c) Signed-off-by: Christopher Faulet (cherry picked from commit b3cb3221e5dabc73deec942a3475ef21289853bd) Signed-off-by: Christopher Faulet --- diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 896d4ee..fc9d956 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -3527,7 +3527,7 @@ static int check_proxy_tcpcheck(struct proxy *px) if (next && next->action == TCPCHK_ACT_CONNECT) { LIST_DEL(&chk->list); LIST_ADD(&next->list, &chk->list); - chk->index = next->index; + chk->index = next->index + 1; } } @@ -3548,7 +3548,7 @@ static int check_proxy_tcpcheck(struct proxy *px) goto out; } LIST_ADDQ(px->tcpcheck_rules.list, &next->list); - next->index = chk->index; + next->index = chk->index + 1; } }