Since qdisc core already assumes all qdiscs are able to output JSON, add JSON output support to multiq. Fixes: c91d262f414d ("tc: jsonify qdisc core") Signed-off-by: Victor Nogueira --- tc/q_multiq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tc/q_multiq.c b/tc/q_multiq.c index 63fffed4..08a2a3b0 100644 --- a/tc/q_multiq.c +++ b/tc/q_multiq.c @@ -51,6 +51,7 @@ static int multiq_parse_opt(const struct qdisc_util *qu, int argc, char **argv, static int multiq_print_opt(const struct qdisc_util *qu, FILE *f, struct rtattr *opt) { struct tc_multiq_qopt *qopt; + SPRINT_BUF(b1); if (opt == NULL) return 0; @@ -59,7 +60,8 @@ static int multiq_print_opt(const struct qdisc_util *qu, FILE *f, struct rtattr qopt = RTA_DATA(opt); - fprintf(f, "bands %u/%u ", qopt->bands, qopt->max_bands); + snprintf(b1, SPRINT_BSIZE, "%u/%u", qopt->bands, qopt->max_bands); + print_string(PRINT_ANY, "bands", "bands %s ", b1); return 0; } -- 2.52.0