From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:41670 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbeBRTrR (ORCPT ); Sun, 18 Feb 2018 14:47:17 -0500 Received: by mail-wr0-f193.google.com with SMTP id f14so3198619wre.8 for ; Sun, 18 Feb 2018 11:47:17 -0800 (PST) From: Adam Vyskovsky To: stephen@networkplumber.org Cc: netdev@vger.kernel.org, Adam Vyskovsky Subject: [PATCH iproute2-next] tc: fix an off-by-one error while printing tc actions Date: Sun, 18 Feb 2018 20:50:10 +0100 Message-Id: <20180218195010.6902-1-adamvyskovsky@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- tc/m_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_action.c b/tc/m_action.c index 744bde41..6c3049c7 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -365,7 +365,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", -- 2.16.1