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-8-stephen@networkplumber.org>
Date:   Tue, 10 Jul 2018 14:05:34 -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 07/31] tc/red: use new JSON helpers

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

Now have simplier way to print size.

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
 tc/q_red.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/tc/q_red.c b/tc/q_red.c
index 49fd4ac80513..9e4124befdb7 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -163,10 +163,6 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	struct tc_red_qopt *qopt;
 	__u32 max_P = 0;
 
-	SPRINT_BUF(b1);
-	SPRINT_BUF(b2);
-	SPRINT_BUF(b3);
-
 	if (opt == NULL)
 		return 0;
 
@@ -182,12 +178,9 @@ static int red_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	    RTA_PAYLOAD(tb[TCA_RED_MAX_P]) >= sizeof(__u32))
 		max_P = rta_getattr_u32(tb[TCA_RED_MAX_P]);
 
-	print_uint(PRINT_JSON, "limit", NULL, qopt->limit);
-	print_string(PRINT_FP, NULL, "limit %s ", sprint_size(qopt->limit, b1));
-	print_uint(PRINT_JSON, "min", NULL, qopt->qth_min);
-	print_string(PRINT_FP, NULL, "min %s ", sprint_size(qopt->qth_min, b2));
-	print_uint(PRINT_JSON, "max", NULL, qopt->qth_max);
-	print_string(PRINT_FP, NULL, "max %s ", sprint_size(qopt->qth_max, b3));
+	print_size("limit", "limit %s ", qopt->limit);
+	print_size("min", "min %s ", qopt->qth_min);
+	print_size("max", "max %s ", qopt->qth_max);
 
 	if (qopt->flags & TC_RED_ECN)
 		print_bool(PRINT_ANY, "ecn", "ecn ", true);
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ