BUG/MINOR: stktable: allow sc-add-gpc from tcp-request connection

Following the previous commit's logic, we enable the use of sc-add-gpc
from tcp-request connection since it was probably forgotten in the first
place for sc-set-gpt0, and since sc-add-gpc was inspired from it, it also
lacks its.

As sc-add-gpc was implemented in 5a72d03a58 ("MINOR: stick-table: implement
the sc-add-gpc() action"), this should only be backported to 2.8
This commit is contained in:
Aurelien DARRAGON 2023-08-09 17:39:29 +02:00 committed by Willy Tarreau
parent 6c79309fda
commit 7eb05891d8

View File

@ -2966,6 +2966,7 @@ static enum act_return action_add_gpc(struct act_rule *rule, struct proxy *px,
value = (unsigned int)(rule->arg.gpc.value); value = (unsigned int)(rule->arg.gpc.value);
else { else {
switch (rule->from) { switch (rule->from) {
case ACT_F_TCP_REQ_CON: smp_opt_dir = SMP_OPT_DIR_REQ; break;
case ACT_F_TCP_REQ_SES: smp_opt_dir = SMP_OPT_DIR_REQ; break; case ACT_F_TCP_REQ_SES: smp_opt_dir = SMP_OPT_DIR_REQ; break;
case ACT_F_TCP_REQ_CNT: smp_opt_dir = SMP_OPT_DIR_REQ; break; case ACT_F_TCP_REQ_CNT: smp_opt_dir = SMP_OPT_DIR_REQ; break;
case ACT_F_TCP_RES_CNT: smp_opt_dir = SMP_OPT_DIR_RES; break; case ACT_F_TCP_RES_CNT: smp_opt_dir = SMP_OPT_DIR_RES; break;
@ -3066,6 +3067,7 @@ static enum act_parse_ret parse_add_gpc(const char **args, int *arg, struct prox
return ACT_RET_PRS_ERR; return ACT_RET_PRS_ERR;
switch (rule->from) { switch (rule->from) {
case ACT_F_TCP_REQ_CON: smp_val = SMP_VAL_FE_CON_ACC; break;
case ACT_F_TCP_REQ_SES: smp_val = SMP_VAL_FE_SES_ACC; break; case ACT_F_TCP_REQ_SES: smp_val = SMP_VAL_FE_SES_ACC; break;
case ACT_F_TCP_REQ_CNT: smp_val = SMP_VAL_FE_REQ_CNT; break; case ACT_F_TCP_REQ_CNT: smp_val = SMP_VAL_FE_REQ_CNT; break;
case ACT_F_TCP_RES_CNT: smp_val = SMP_VAL_BE_RES_CNT; break; case ACT_F_TCP_RES_CNT: smp_val = SMP_VAL_BE_RES_CNT; break;