Skip to contentSkip to conversation

tc: fix a misleading failure

PATCH New Cong Wang 1 participant 1 message Aug 8, 2016

Subsystems (2)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 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 <[email protected]>
Cc Jamal Hadi Salim <[email protected]>
---
 tc/m_action.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
tc/m_action.c +3 -5
index 24f8b5d..bb19df8 100644
@@ -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;
Signature · 1 line
2.1.0