DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/dumpcap: don't pass negative value to strerror() on error
@ 2023-02-07 17:00 Stephen Hemminger
  2023-02-19 17:50 ` Stephen Hemminger
  2023-03-12 14:16 ` Thomas Monjalon
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2023-02-07 17:00 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

If eth_stats_get fails (for example with -ENOTSUPP) then
dumpcap would pass that to strerror which is incorrect.

Fixes: 8744f84bb255 ("app/dumpcap: add statistics mode")
Coverity issue: 383136
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/dumpcap/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 904eb5a7d7d9..64294bbfb3e6 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -500,7 +500,7 @@ static void statistics_loop(void)
 			if (r < 0) {
 				fprintf(stderr,
 					"stats_get for port %u failed: %d (%s)\n",
-					p, r, strerror(r));
+					p, r, strerror(-r));
 				return;
 			}
 
-- 
2.39.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-12 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 17:00 [PATCH] app/dumpcap: don't pass negative value to strerror() on error Stephen Hemminger
2023-02-19 17:50 ` Stephen Hemminger
2023-03-12 14:16 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).