From cb9106b3e3c43d895f2157dcdd2a0596f3ec94dd Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 19 Dec 2019 15:23:17 +0100 Subject: [PATCH] MINOR: tcp-rules: Always set from which ruleset a rule comes from The ruleset from which a TCP rule comes from (the field in the act_rule structure) is only set when a rule is created from a registered keyword and not for all TCP rules. But this information may be useful to check the configuration validity or during the rule evaluation. So now, we systematically set it. --- src/tcp_rules.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/tcp_rules.c b/src/tcp_rules.c index 86b4df5381..e87b70b827 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -606,7 +606,6 @@ static int tcp_parse_response_rule(char **args, int arg, int section_type, kw = tcp_res_cont_action(args[arg]); if (kw) { arg++; - rule->from = ACT_F_TCP_RES_CNT; rule->kw = kw; if (kw->parse((const char **)args, &arg, curpx, rule, err) == ACT_RET_PRS_ERR) return -1; @@ -838,17 +837,14 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type, /* L4 */ kw = tcp_req_conn_action(args[arg]); rule->kw = kw; - rule->from = ACT_F_TCP_REQ_CON; } else if (where & SMP_VAL_FE_SES_ACC) { /* L5 */ kw = tcp_req_sess_action(args[arg]); rule->kw = kw; - rule->from = ACT_F_TCP_REQ_SES; } else { /* L6 */ kw = tcp_req_cont_action(args[arg]); rule->kw = kw; - rule->from = ACT_F_TCP_REQ_CNT; } if (kw) { arg++; @@ -952,7 +948,7 @@ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx, where |= SMP_VAL_FE_RES_CNT; if (curpx->cap & PR_CAP_BE) where |= SMP_VAL_BE_RES_CNT; - + rule->from = ACT_F_TCP_RES_CNT; if (tcp_parse_response_rule(args, arg, section_type, curpx, defpx, rule, err, where, file, line) < 0) goto error; @@ -1066,7 +1062,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, where |= SMP_VAL_FE_REQ_CNT; if (curpx->cap & PR_CAP_BE) where |= SMP_VAL_BE_REQ_CNT; - + rule->from = ACT_F_TCP_REQ_CNT; if (tcp_parse_request_rule(args, arg, section_type, curpx, defpx, rule, err, where, file, line) < 0) goto error; @@ -1111,7 +1107,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, } where |= SMP_VAL_FE_CON_ACC; - + rule->from = ACT_F_TCP_REQ_CON; if (tcp_parse_request_rule(args, arg, section_type, curpx, defpx, rule, err, where, file, line) < 0) goto error; @@ -1156,7 +1152,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, } where |= SMP_VAL_FE_SES_ACC; - + rule->from = ACT_F_TCP_REQ_SES; if (tcp_parse_request_rule(args, arg, section_type, curpx, defpx, rule, err, where, file, line) < 0) goto error; -- 2.47.3