From 2eafa55e72845bd7dbeb3bc117dd1fda0f54a775 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 25 Jun 2021 11:37:45 +0200 Subject: [PATCH] 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 --- src/tcpcheck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } } -- 1.7.10.4