tc: gact: fix control action parsing
parse_action_control helper does advancing of the arg inside. So don't
do it outside.
Fixes: e67aba5595 ("tc: actions: add helpers to parse and print control actions")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
This commit is contained in:
parent
6ea2c2b1cf
commit
18f05d0601
|
|
@ -90,17 +90,14 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
|
||||||
|
|
||||||
if (matches(*argv, "gact") == 0) {
|
if (matches(*argv, "gact") == 0) {
|
||||||
ok++;
|
ok++;
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
} else {
|
} else {
|
||||||
if (parse_action_control(&argc, &argv, &p.action, false) == -1)
|
if (parse_action_control(&argc, &argv, &p.action, false) == -1)
|
||||||
usage();
|
usage();
|
||||||
ok++;
|
ok++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok) {
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_GACT_PROB
|
#ifdef CONFIG_GACT_PROB
|
||||||
if (ok && argc > 0) {
|
if (ok && argc > 0) {
|
||||||
if (matches(*argv, "random") == 0) {
|
if (matches(*argv, "random") == 0) {
|
||||||
|
|
@ -120,8 +117,6 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
|
||||||
if (parse_action_control(&argc, &argv,
|
if (parse_action_control(&argc, &argv,
|
||||||
&pp.paction, false) == -1)
|
&pp.paction, false) == -1)
|
||||||
usage();
|
usage();
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
if (get_u16(&pp.pval, *argv, 10)) {
|
if (get_u16(&pp.pval, *argv, 10)) {
|
||||||
fprintf(stderr, "Illegal probability val 0x%x\n", pp.pval);
|
fprintf(stderr, "Illegal probability val 0x%x\n", pp.pval);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue