netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch iproute2] tc: fix a misleading failure
@ 2016-08-08 23:24 Cong Wang
  0 siblings, 0 replies; only message in thread
From: Cong Wang @ 2016-08-08 23:24 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, Stephen Hemminger, Jamal Hadi Salim

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@brocade.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-08 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-08 23:24 [Patch iproute2] tc: fix a misleading failure Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).