diff --git a/src/stick_table.c b/src/stick_table.c index e50ef2571..6f07080f6 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -2633,9 +2633,13 @@ static enum act_parse_ret parse_set_gpt(const char **args, int *arg, struct prox return ACT_RET_PRS_ERR; } + /* value may be either an integer or an expression */ rule->arg.gpt.expr = NULL; rule->arg.gpt.value = strtol(args[*arg], &error, 10); - if (*error != '\0') { + if (*error == '\0') { + /* valid integer, skip it */ + (*arg)++; + } else { rule->arg.gpt.expr = sample_parse_expr((char **)args, arg, px->conf.args.file, px->conf.args.line, err, &px->conf.args, NULL); if (!rule->arg.gpt.expr) @@ -2658,7 +2662,6 @@ static enum act_parse_ret parse_set_gpt(const char **args, int *arg, struct prox return ACT_RET_PRS_ERR; } } - (*arg)++; rule->action = ACT_CUSTOM;