Skip to content

Commit cb83101

Browse files
w1ldptrshemminger
authored andcommittedNov 1, 2019
tc: remove duplicated NEXT_ARG_FWD() in parse_ct()
Function parse_ct() manually calls NEXT_ARG_FWD() after parse_action_control_dflt(). This is redundant because parse_action_control_dflt() modifies argc and argv itself. Moreover, such implementation parses out any following actions option. For example, adding action ct with cookie errors: $ sudo tc actions add action ct cookie 111111111111 Bad action type 111111111111 Usage: ... gact <ACTION> [RAND] [INDEX] Where: ACTION := reclassify | drop | continue | pass | pipe | goto chain <CHAIN_INDEX> | jump <JUMP_COUNT> RAND := random <RANDTYPE> <ACTION> <VAL> RANDTYPE := netrand | determ VAL : = value not exceeding 10000 JUMP_COUNT := Absolute jump from start of action list INDEX := index value used With fix: $ sudo tc actions add action ct cookie 111111111111 $ sudo tc actions list action ct total acts 1 action order 0: ct zone 0 pipe index 1 ref 1 bind 0 cookie 111111111111 Fixes: c8a4943 ("tc: Introduce tc ct action") Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
1 parent 4f73cd7 commit cb83101

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed
 

‎tc/m_ct.c

-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ parse_ct(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
316316

317317
parse_action_control_dflt(&argc, &argv, &sel.action, false,
318318
TC_ACT_PIPE);
319-
NEXT_ARG_FWD();
320319

321320
addattr16(n, MAX_MSG, TCA_CT_ACTION, ct_action);
322321
addattr_l(n, MAX_MSG, TCA_CT_PARMS, &sel, sizeof(sel));

0 commit comments

Comments
 (0)
Please sign in to comment.