]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tcpcheck: Fix numbering of implicit HTTP send/expect rules
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 25 Jun 2021 09:37:45 +0000 (11:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 25 Jun 2021 12:03:45 +0000 (14:03 +0200)
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.

src/tcpcheck.c

index 4e594a9f795dd8fc7356d8bd652a3a29d426927d..9610760d75e705879b56e13bdacdb7186383b98e 100644 (file)
@@ -3637,7 +3637,7 @@ static int check_proxy_tcpcheck(struct proxy *px)
                        if (next && next->action == TCPCHK_ACT_CONNECT) {
                                LIST_DELETE(&chk->list);
                                LIST_INSERT(&next->list, &chk->list);
-                               chk->index = next->index;
+                               chk->index = next->index + 1;
                        }
                }
 
@@ -3658,7 +3658,7 @@ static int check_proxy_tcpcheck(struct proxy *px)
                                goto out;
                        }
                        LIST_APPEND(px->tcpcheck_rules.list, &next->list);
-                       next->index = chk->index;
+                       next->index = chk->index + 1;
                }
        }