summaryrefslogtreecommitdiff
path: root/tc/m_mirred.c
diff options
context:
space:
mode:
authorDavide Caratti <dcaratti@redhat.com>2018-03-02 19:36:16 +0100
committerStephen Hemminger <stephen@networkplumber.org>2018-03-04 09:01:38 -0800
commit75ef7b18d2a13657056706895bf8d8dd3ac93e46 (patch)
treea60ed7753e1181a3a3ee4e81040286dd3afebbd9 /tc/m_mirred.c
parenteb8559eff124221bfbafe934c4dbfe30f20604c0 (diff)
tc: fix parsing of the control action
If the user didn't specify any control action, don't pop the command line arguments: otherwise, parsing of the next argument (tipically the 'index' keyword) results in an error, causing the following 'tc-testing' failures: Test a6d6: Add skbedit action with index Test 38f3: Delete skbedit action Test a568: Add action with ife type Test b983: Add action without ife type Test 7d50: Add skbmod action to set destination mac Test 9b29: Add skbmod action to set source mac Test e93a: Delete an skbmod action Also, add missing parse for 'ok' control action to m_police, to fix the following 'tc-testing' failure: Test 8dd5: Add police action with control ok tested with: # ./tdc.py test results: all tests ok using kernel 4.16-rc2, except 9aa8 "Get a single skbmod action from a list" (which is failing also before this commit) Fixes: 3572e01a090a ("tc: util: Don't call NEXT_ARG_FWD() in __parse_action_control()") Cc: Michal Privoznik <mprivozn@redhat.com> Cc: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'tc/m_mirred.c')
-rw-r--r--tc/m_mirred.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index aa7ce6d9..14e5c88d 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -103,6 +103,7 @@ parse_direction(struct action_util *a, int *argc_p, char ***argv_p,
while (argc > 0) {
if (matches(*argv, "action") == 0) {
+ NEXT_ARG();
break;
} else if (!egress && matches(*argv, "egress") == 0) {
egress = 1;
@@ -202,10 +203,8 @@ 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) {