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]
Date:   Tue, 10 Jul 2018 14:05:38 -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 11/31] tc/drr: implement JSON output

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

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

diff --git a/tc/q_drr.c b/tc/q_drr.c
index f9c90f3035f3..882cd4a37ec7 100644
--- a/tc/q_drr.c
+++ b/tc/q_drr.c
@@ -84,16 +84,14 @@ static int drr_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 {
 	struct rtattr *tb[TCA_DRR_MAX + 1];
 
-	SPRINT_BUF(b1);
-
 	if (opt == NULL)
 		return 0;
 
 	parse_rtattr_nested(tb, TCA_DRR_MAX, opt);
 
 	if (tb[TCA_DRR_QUANTUM])
-		fprintf(f, "quantum %s ",
-			sprint_size(rta_getattr_u32(tb[TCA_DRR_QUANTUM]), b1));
+		print_size("quantum", "quantum %s ",
+			   rta_getattr_u32(tb[TCA_DRR_QUANTUM]));
 	return 0;
 }
 
@@ -101,15 +99,13 @@ static int drr_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstat
 {
 	struct tc_drr_stats *x;
 
-	SPRINT_BUF(b1);
-
 	if (xstats == NULL)
 		return 0;
 	if (RTA_PAYLOAD(xstats) < sizeof(*x))
 		return -1;
 	x = RTA_DATA(xstats);
 
-	fprintf(f, " deficit %s ", sprint_size(x->deficit, b1));
+	print_size("deficit", " deficit %s ", x->deficit);
 	return 0;
 }
 
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ