lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180710210558.20278-19-stephen@networkplumber.org>
Date:   Tue, 10 Jul 2018 14:05:45 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     netdev@...r.kernel.org
Cc:     Stephen Hemminger <sthemmin@...rosoft.com>,
        Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH v2 iproute2-next 18/31] tc/fifo: implement JSON output

From: Stephen Hemminger <sthemmin@...rosoft.com>

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
 tc/q_fifo.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tc/q_fifo.c b/tc/q_fifo.c
index 5fd6c1b1107d..65a7b0e218f2 100644
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -67,11 +67,10 @@ static int fifo_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	if (RTA_PAYLOAD(opt)  < sizeof(*qopt))
 		return -1;
 	qopt = RTA_DATA(opt);
-	if (strcmp(qu->id, "bfifo") == 0) {
-		SPRINT_BUF(b1);
-		fprintf(f, "limit %s", sprint_size(qopt->limit, b1));
-	} else
-		fprintf(f, "limit %up", qopt->limit);
+	if (strcmp(qu->id, "bfifo") == 0)
+		print_size("limit", "limit %s", qopt->limit);
+	else
+		print_uint(PRINT_ANY, "limit", "limit %up", qopt->limit);
 	return 0;
 }
 
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ