From: Adam Vyskovsky Date: Sun, 18 Feb 2018 19:50:10 +0000 (+0100) Subject: tc: fix an off-by-one error while printing tc actions X-Git-Tag: v4.16.0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb854d07cb80fe11593b9da8f34feb62b7e401e;p=thirdparty%2Fiproute2.git 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 Signed-off-by: Stephen Hemminger --- diff --git a/tc/m_action.c b/tc/m_action.c index 445d0b69b..148f1372d 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -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",