]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: fix an off-by-one error while printing tc actions
authorAdam Vyskovsky <adamvyskovsky@gmail.com>
Sun, 18 Feb 2018 19:50:10 +0000 (20:50 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 23 Feb 2018 16:18:29 +0000 (08:18 -0800)
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>
tc/m_action.c

index 445d0b69bb7566586830dbe9e0dc765dbfeb21c2..148f1372d41458844450a9ede7098500c28face9 100644 (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",