diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2024-02-09 08:47:06 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2024-02-10 09:48:49 -0800 |
commit | e449400508eff4cb4ac69e3a798a18e7aaa34c1b (patch) | |
tree | 56e5cee9e8b829e756daf72956b7a336f8131964 /tc | |
parent | 3c4712b95d0c9d370c26294d3434235cb35a0619 (diff) |
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 <stephen@networkplumber.org>
Diffstat (limited to 'tc')
-rw-r--r-- | tc/f_u32.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |