tc: fix an off-by-one error while printing tc actions

The tc_print_action() function did not print all tc actions
when e.g. TCA_ACT_MAX_PRIO actions were defined for a single
tc filter.

Signed-off-by: Adam Vyskovsky <adamvyskovsky@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Adam Vyskovsky 2018-02-18 20:50:10 +01:00 committed by Stephen Hemminger
parent 7bdd623948
commit 2fb854d07c

View File

@ -368,7 +368,7 @@ tc_print_action(FILE *f, const struct rtattr *arg, unsigned short tot_acts)
return tc_print_action_flush(f, tb[0]);
open_json_array(PRINT_JSON, "actions");
for (i = 0; i < tot_acts; i++) {
for (i = 0; i <= tot_acts; i++) {
if (tb[i]) {
open_json_object(NULL);
print_uint(PRINT_ANY, "order",