From: Stephen Hemminger Date: Fri, 9 Feb 2024 16:47:06 +0000 (-0800) Subject: tc: u32: errors should be printed on stderr X-Git-Tag: v6.8.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e449400508eff4cb4ac69e3a798a18e7aaa34c1b;p=thirdparty%2Fiproute2.git tc: u32: errors should be printed on stderr Don't corrupt stdout with error messages, matters if JSON is used. Signed-off-by: Stephen Hemminger --- diff --git a/tc/f_u32.c b/tc/f_u32.c index 936dbd65..913ec1de 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -1300,7 +1300,7 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, if (tb[TCA_U32_PCNT]) { if (RTA_PAYLOAD(tb[TCA_U32_PCNT]) < sizeof(*pf)) { - fprintf(f, "Broken perf counters\n"); + fprintf(stderr, "Broken perf counters\n"); return -1; } pf = RTA_DATA(tb[TCA_U32_PCNT]); @@ -1315,7 +1315,7 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, struct tc_u32_mark *mark = RTA_DATA(tb[TCA_U32_MARK]); if (RTA_PAYLOAD(tb[TCA_U32_MARK]) < sizeof(*mark)) { - fprintf(f, "\n Invalid mark (kernel&iproute2 mismatch)\n"); + fprintf(stderr, "Invalid mark (kernel&iproute2 mismatch)\n"); } else { print_nl(); print_0xhex(PRINT_ANY, "fwmark_value", " mark 0x%04x ", mark->val);