aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2024-02-09 08:47:06 -0800
committerStephen Hemminger <stephen@networkplumber.org>2024-02-10 09:48:49 -0800
commite449400508eff4cb4ac69e3a798a18e7aaa34c1b (patch)
tree56e5cee9e8b829e756daf72956b7a336f8131964
parent3c4712b95d0c9d370c26294d3434235cb35a0619 (diff)
downloadiproute2-e449400508eff4cb4ac69e3a798a18e7aaa34c1b.tar.gz
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>
-rw-r--r--tc/f_u32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 936dbd65d..913ec1de4 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);