[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 8 Aug 2016 16:24:45 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: Cong Wang <xiyou.wangcong@...il.com>,
Stephen Hemminger <shemming@...cade.com>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: [Patch iproute2] tc: fix a misleading failure
Before this patch:
# ./tc/tc actions add action drop index 11
RTNETLINK answers: File exists
We have an error talking to the kernel
Command "(null)" is unknown, try "tc actions help".
After this patch:
# ./tc/tc actions add action drop index 11
RTNETLINK answers: File exists
We have an error talking to the kernel
Cc: Stephen Hemminger <shemming@...cade.com>
Cc: Jamal Hadi Salim <jhs@...atatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
---
tc/m_action.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tc/m_action.c b/tc/m_action.c
index 24f8b5d..bb19df8 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -623,14 +623,12 @@ int do_action(int argc, char **argv)
act_usage();
return -1;
} else {
-
- ret = -1;
- }
-
- if (ret < 0) {
fprintf(stderr, "Command \"%s\" is unknown, try \"tc actions help\".\n", *argv);
return -1;
}
+
+ if (ret < 0)
+ return -1;
}
return 0;
--
2.1.0
Powered by blists - more mailing lists