Set ret to -1 on the "bad action" paths of tc_act_list_or_flush(),
which exit 0 today:
# tc actions ls action nosuch
bad action nosuch
# echo $?
0
Signed-off-by: Dave Seddon <dave…@gmail.com>
---
tc/m_action.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tc/m_action.c b/tc/m_action.c
index bbc8e6a6..ee6d2aac 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -791,10 +791,12 @@ static int tc_act_list_or_flush(int *argc_p, char ***argv_p, int event)
a = get_action_kind(k);
if (a == NULL) {
fprintf(stderr, "bad action %s\n", k);
+ ret = -1;
goto bad_val;
}
if (strcmp(a->id, k) != 0) {
fprintf(stderr, "bad action %s\n", k);
+ ret = -1;
goto bad_val;
}
strncpy(k, *argv, sizeof(k) - 1);
--
2.56.0