app/dumpcap: don't pass negative value to strerror() on error
PATCH 1/1 app/dumpcap: don't pass negative value to strerror() on error
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 <[email protected]>
--- app/dumpcap/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/dumpcap/main.c +1 -1
@@ -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 ; }
Signature · 1 line
2.39.1
Quoted 6 lines · On Tue, 7 Feb 2023 09:00:50 -0800 Stephen Hemminger…
If
eth_stats_getfails (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 <[email protected]>
Small bug fix, please apply
Thomas Monjalon
Applied07/02/2023 18:00, Stephen Hemminger:
Quoted 6 lines
If
eth_stats_getfails (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 <[email protected]>
Changed the title to highlight the user facing change:
app/dumpcap: fix error message when getting statistics
Applied, thanks.