BUG/MINOR: rules: Fix check_capture() function to use the right rule arguments
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 Apr 2022 12:57:58 +0000 (14:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Apr 2022 13:49:18 +0000 (15:49 +0200)
The function checking captures defined in tcp-request content ruleset didn't
use the right rule arguments. "arg.trk_ctr" was used instead of "arg.cap".

This patch must be backported as far as 2.2.

(cherry picked from commit 643f1b7befa9c97575aa41d705606c6fda4ed94c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 373d4ab4f1a1ad272262debf5b258f1161909f2d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 70e80e03ef9149a048c3f5f6f6cba471d557af4c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/action.c

index 38195b3..6a47da7 100644 (file)
@@ -128,7 +128,7 @@ int check_trk_action(struct act_rule *rule, struct proxy *px, char **err)
 int check_capture(struct act_rule *rule, struct proxy *px, char **err)
 {
        if (rule->from == ACT_F_TCP_REQ_CNT && (px->cap & PR_CAP_FE) && !px->tcp_req.inspect_delay &&
-           !(rule->arg.trk_ctr.expr->fetch->val & SMP_VAL_FE_SES_ACC)) {
+           !(rule->arg.cap.expr->fetch->val & SMP_VAL_FE_SES_ACC)) {
                ha_warning("config : %s '%s' : a 'tcp-request capture' rule explicitly depending on request"
                           " contents without any 'tcp-request inspect-delay' setting."
                           " This means that this rule will randomly find its contents. This can be fixed by"