BUG/MINOR: tcp_act: fix attach-srv rule ACL parsing

Fix parser for tcp-request session attach-srv rule. Before this commit,
it was impossible to use an anonymous ACL with it. This was caused
because support for optional name argument was badly implemented.

No need to backport this.
This commit is contained in:
Amaury Denoyelle 2023-09-29 16:05:14 +02:00
parent 6118590e95
commit 753fe2b9ac
1 changed files with 12 additions and 15 deletions

View File

@ -505,8 +505,11 @@ static enum act_parse_ret tcp_parse_attach_srv(const char **args, int *cur_arg,
++(*cur_arg);
while (args[*cur_arg] && args[*cur_arg][0] != '\0') {
if (strcmp(args[*cur_arg], "name") == 0) {
if (!*args[*cur_arg + 1]) {
memprintf(err, "missing name value");
return ACT_RET_PRS_ERR;
}
++(*cur_arg);
expr = sample_parse_expr((char **)args, cur_arg, px->conf.args.file, px->conf.args.line,
@ -516,12 +519,6 @@ static enum act_parse_ret tcp_parse_attach_srv(const char **args, int *cur_arg,
rule->arg.attach_srv.name = expr;
rule->release_ptr = release_attach_srv_action;
++(*cur_arg);
}
else {
memprintf(err, "Unknown argument.");
return ACT_RET_PRS_ERR;
}
}
return ACT_RET_PRS_OK;