mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 05:55:11 +08:00
tc: util: Don't call NEXT_ARG_FWD() in __parse_action_control()
Not all callers want parse_action_control*() to advance the
arguments. For instance act_parse_police() does the argument
advancing itself.
Fixes: e67aba5595
("tc: actions: add helpers to parse and print control actions")
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
00ac78d39c
commit
3572e01a09
@ -129,6 +129,7 @@ opt_bpf:
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &parm.action,
|
||||
false, TC_ACT_PIPE);
|
||||
NEXT_ARG_FWD();
|
||||
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
|
@ -82,6 +82,7 @@ parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
|
||||
}
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_PIPE);
|
||||
NEXT_ARG_FWD();
|
||||
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
|
@ -124,6 +124,7 @@ parse_csum(struct action_util *a, int *argc_p,
|
||||
}
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_OK);
|
||||
NEXT_ARG_FWD();
|
||||
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
|
10
tc/m_gact.c
10
tc/m_gact.c
@ -87,14 +87,13 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
if (argc < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
if (matches(*argv, "gact") == 0) {
|
||||
argc--;
|
||||
argv++;
|
||||
} else if (parse_action_control(&argc, &argv, &p.action, false) == -1) {
|
||||
if (matches(*argv, "gact") != 0 &&
|
||||
parse_action_control(&argc, &argv, &p.action, false) == -1) {
|
||||
usage(); /* does not return */
|
||||
}
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
|
||||
#ifdef CONFIG_GACT_PROB
|
||||
if (argc > 0) {
|
||||
if (matches(*argv, "random") == 0) {
|
||||
@ -114,6 +113,7 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
if (parse_action_control(&argc, &argv,
|
||||
&pp.paction, false) == -1)
|
||||
usage();
|
||||
NEXT_ARG_FWD();
|
||||
if (get_u16(&pp.pval, *argv, 10)) {
|
||||
fprintf(stderr,
|
||||
"Illegal probability val 0x%x\n",
|
||||
|
@ -159,6 +159,7 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -202,8 +202,10 @@ parse_direction(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
}
|
||||
|
||||
|
||||
if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR)
|
||||
if (p.eaction == TCA_EGRESS_MIRROR || p.eaction == TCA_INGRESS_MIRROR) {
|
||||
parse_action_control(&argc, &argv, &p.action, false);
|
||||
NEXT_ARG_FWD();
|
||||
}
|
||||
|
||||
if (argc) {
|
||||
if (iok && matches(*argv, "index") == 0) {
|
||||
|
@ -116,6 +116,7 @@ parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &sel.action, false, TC_ACT_OK);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -672,6 +672,7 @@ int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &sel.sel.action, false, TC_ACT_OK);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -100,6 +100,7 @@ static int parse_sample(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -123,6 +123,7 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
|
||||
parse_action_control_dflt(&argc, &argv, &sel.action,
|
||||
false, TC_ACT_PIPE);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -124,6 +124,7 @@ static int parse_skbmod(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
|
||||
parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -175,6 +175,7 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
parse_action_control_dflt(&argc, &argv, &parm.action,
|
||||
false, TC_ACT_PIPE);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -131,6 +131,7 @@ static int parse_vlan(struct action_util *a, int *argc_p, char ***argv_p,
|
||||
parse_action_control_dflt(&argc, &argv, &parm.action,
|
||||
false, TC_ACT_PIPE);
|
||||
|
||||
NEXT_ARG_FWD();
|
||||
if (argc) {
|
||||
if (matches(*argv, "index") == 0) {
|
||||
NEXT_ARG();
|
||||
|
@ -586,7 +586,6 @@ static int __parse_action_control(int *argc_p, char ***argv_p, int *result_p,
|
||||
}
|
||||
result |= jump_cnt;
|
||||
}
|
||||
NEXT_ARG_FWD();
|
||||
*argc_p = argc;
|
||||
*argv_p = argv;
|
||||
*result_p = result;
|
||||
|
Loading…
Reference in New Issue
Block a user