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-next>] [day] [month] [year] [list]
Message-Id: <20190124203014.7450-1-stephen@networkplumber.org>
Date:   Fri, 25 Jan 2019 09:30:13 +1300
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     netdev@...r.kernel.org
Cc:     Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2-next 1/2] tc: replace print_string with fprintf for error messages

Any error output should go to standard error.

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
 tc/f_matchall.c | 2 +-
 tc/m_connmark.c | 2 +-
 tc/m_csum.c     | 2 +-
 tc/m_gact.c     | 2 +-
 tc/m_ife.c      | 2 +-
 tc/m_mirred.c   | 2 +-
 tc/m_nat.c      | 2 +-
 tc/m_sample.c   | 2 +-
 tc/m_skbedit.c  | 2 +-
 tc/m_vlan.c     | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tc/f_matchall.c b/tc/f_matchall.c
index 03dd51de1ace..59f452c5361e 100644
--- a/tc/f_matchall.c
+++ b/tc/f_matchall.c
@@ -146,7 +146,7 @@ static int matchall_print_opt(struct filter_util *qu, FILE *f,
 
 	if (tb[TCA_MATCHALL_PCNT]) {
 		if (RTA_PAYLOAD(tb[TCA_MATCHALL_PCNT])  < sizeof(*pf)) {
-			print_string(PRINT_FP, NULL, "Broken perf counters\n", NULL);
+			fprintf(stderr, "Performance counter size mismatch\n");
 			return -1;
 		}
 		pf = RTA_DATA(tb[TCA_MATCHALL_PCNT]);
diff --git a/tc/m_connmark.c b/tc/m_connmark.c
index 45e2d05f1a91..34d80b1a27c0 100644
--- a/tc/m_connmark.c
+++ b/tc/m_connmark.c
@@ -114,7 +114,7 @@ static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg)
 
 	parse_rtattr_nested(tb, TCA_CONNMARK_MAX, arg);
 	if (tb[TCA_CONNMARK_PARMS] == NULL) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL connmark parameters]");
+		fprintf(stderr, "NULL connmark parameters\n");
 		return -1;
 	}
 
diff --git a/tc/m_csum.c b/tc/m_csum.c
index 752269d1d020..450f2b557b44 100644
--- a/tc/m_csum.c
+++ b/tc/m_csum.c
@@ -172,7 +172,7 @@ print_csum(struct action_util *au, FILE *f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_CSUM_MAX, arg);
 
 	if (tb[TCA_CSUM_PARMS] == NULL) {
-		fprintf(f, "[NULL csum parameters]");
+		fprintf(stderr, "missing csum parameters\n");
 		return -1;
 	}
 	sel = RTA_DATA(tb[TCA_CSUM_PARMS]);
diff --git a/tc/m_gact.c b/tc/m_gact.c
index a0a3c33d23da..342927bc2ed7 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -174,7 +174,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_GACT_MAX, arg);
 
 	if (tb[TCA_GACT_PARMS] == NULL) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL gact parameters]");
+		fprintf(stderr, "[NULL gact parameters]\n");
 		return -1;
 	}
 	p = RTA_DATA(tb[TCA_GACT_PARMS]);
diff --git a/tc/m_ife.c b/tc/m_ife.c
index 2bf9f2047b46..b754cfc3a03a 100644
--- a/tc/m_ife.c
+++ b/tc/m_ife.c
@@ -234,7 +234,7 @@ static int print_ife(struct action_util *au, FILE *f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_IFE_MAX, arg);
 
 	if (tb[TCA_IFE_PARMS] == NULL) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL ife parameters]");
+		fprintf(stderr, "[NULL ife parameters]\n");
 		return -1;
 	}
 	p = RTA_DATA(tb[TCA_IFE_PARMS]);
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index c7f7318b8413..fb4cab5fb9eb 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -286,7 +286,7 @@ print_mirred(struct action_util *au, FILE *f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_MIRRED_MAX, arg);
 
 	if (tb[TCA_MIRRED_PARMS] == NULL) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL mirred parameters]");
+		fprintf(stderr, "mirred parameters missing\n");
 		return -1;
 	}
 	p = RTA_DATA(tb[TCA_MIRRED_PARMS]);
diff --git a/tc/m_nat.c b/tc/m_nat.c
index ee0b7520a605..4cd255299ccb 100644
--- a/tc/m_nat.c
+++ b/tc/m_nat.c
@@ -152,7 +152,7 @@ print_nat(struct action_util *au, FILE * f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_NAT_MAX, arg);
 
 	if (tb[TCA_NAT_PARMS] == NULL) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL nat parameters]");
+		fprintf(stderr, "[NULL nat parameters]\n");
 		return -1;
 	}
 	sel = RTA_DATA(tb[TCA_NAT_PARMS]);
diff --git a/tc/m_sample.c b/tc/m_sample.c
index 39a99246a8ea..2af098ecba90 100644
--- a/tc/m_sample.c
+++ b/tc/m_sample.c
@@ -149,7 +149,7 @@ static int print_sample(struct action_util *au, FILE *f, struct rtattr *arg)
 
 	if (!tb[TCA_SAMPLE_PARMS] || !tb[TCA_SAMPLE_RATE] ||
 	    !tb[TCA_SAMPLE_PSAMPLE_GROUP]) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL sample parameters]");
+		fprintf(stderr, "[NULL sample parameters]\n");
 		return -1;
 	}
 	p = RTA_DATA(tb[TCA_SAMPLE_PARMS]);
diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c
index b6b839f8ef6c..ee0cd987fa3a 100644
--- a/tc/m_skbedit.c
+++ b/tc/m_skbedit.c
@@ -186,7 +186,7 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_SKBEDIT_MAX, arg);
 
 	if (tb[TCA_SKBEDIT_PARMS] == NULL) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL skbedit parameters]");
+		fprintf(stderr, "[NULL skbedit parameters]\n");
 		return -1;
 	}
 	p = RTA_DATA(tb[TCA_SKBEDIT_PARMS]);
diff --git a/tc/m_vlan.c b/tc/m_vlan.c
index 412f6aa1000e..f58bbf0a0320 100644
--- a/tc/m_vlan.c
+++ b/tc/m_vlan.c
@@ -188,7 +188,7 @@ static int print_vlan(struct action_util *au, FILE *f, struct rtattr *arg)
 	parse_rtattr_nested(tb, TCA_VLAN_MAX, arg);
 
 	if (!tb[TCA_VLAN_PARMS]) {
-		print_string(PRINT_FP, NULL, "%s", "[NULL vlan parameters]");
+		fprintf(stderr, "[NULL vlan parameters]\n");
 		return -1;
 	}
 	parm = RTA_DATA(tb[TCA_VLAN_PARMS]);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ