From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: [patch iproute2 1/2] tc: move action cookie print out of the stats if Date: Sat, 25 Nov 2017 11:07:56 +0100 Message-ID: <20171125100757.1426-2-jiri@resnulli.us> References: <20171125100757.1426-1-jiri@resnulli.us> Cc: stephen@networkplumber.org, jhs@mojatatu.com, mlxsw@mellanox.com To: netdev@vger.kernel.org Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:39761 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbdKYKIB (ORCPT ); Sat, 25 Nov 2017 05:08:01 -0500 Received: by mail-wr0-f193.google.com with SMTP id 11so18876742wrb.6 for ; Sat, 25 Nov 2017 02:08:00 -0800 (PST) In-Reply-To: <20171125100757.1426-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko Cookie print was made dependent on show_stats for no good reason. Fix this bu pushing cookie print ot of the stats if. Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies") Signed-off-by: Jiri Pirko --- tc/m_action.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index 85f9e27..aa3aa52 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -301,19 +301,18 @@ static int tc_print_one_action(FILE *f, struct rtattr *arg) return err; if (show_stats && tb[TCA_ACT_STATS]) { - fprintf(f, "\tAction statistics:\n"); print_tcstats2_attr(f, tb[TCA_ACT_STATS], "\t", NULL); - if (tb[TCA_ACT_COOKIE]) { - int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); - char b1[strsz * 2 + 1]; - - fprintf(f, "\n\tcookie len %d %s ", strsz, - hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), - strsz, b1, sizeof(b1))); - } fprintf(f, "\n"); } + if (tb[TCA_ACT_COOKIE]) { + int strsz = RTA_PAYLOAD(tb[TCA_ACT_COOKIE]); + char b1[strsz * 2 + 1]; + + fprintf(f, "\tcookie len %d %s\n", strsz, + hexstring_n2a(RTA_DATA(tb[TCA_ACT_COOKIE]), + strsz, b1, sizeof(b1))); + } return 0; } -- 2.9.5