DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] dumpcap: check return value from adding interface
@ 2024-10-27 18:28 Stephen Hemminger
  2024-10-27 20:25 ` Morten Brørup
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephen Hemminger @ 2024-10-27 18:28 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The rte_pcapng_add_interface could fail.
For example: running out of space for the file.

Covertity issue: 446742
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/dumpcap/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index fcfaa19951..260ca72dc6 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,9 +800,9 @@ static dumpcap_out_t create_output(void)
 		free(os);
 
 		TAILQ_FOREACH(intf, &interfaces, next) {
-			rte_pcapng_add_interface(ret.pcapng, intf->port,
-						 intf->ifname, intf->ifdescr,
-						 intf->opts.filter);
+			if (rte_pcapng_add_interface(ret.pcapng, intf->port, intf->ifname,
+						     intf->ifdescr, intf->opts.filter) < 0)
+				rte_exit(EXIT_FAILURE, "pcapng_add_interface %u failed\n", intf->port);
 		}
 	} else {
 		pcap_t *pcap;
-- 
2.45.2


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

* RE: [PATCH] dumpcap: check return value from adding interface
  2024-10-27 18:28 [PATCH] dumpcap: check return value from adding interface Stephen Hemminger
@ 2024-10-27 20:25 ` Morten Brørup
  2024-10-28  0:00 ` fengchengwen
  2024-10-30 14:09 ` David Marchand
  2 siblings, 0 replies; 4+ messages in thread
From: Morten Brørup @ 2024-10-27 20:25 UTC (permalink / raw)
  To: Stephen Hemminger, dev

Acked-by: Morten Brørup <mb@smartsharesystems.com>


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

* Re: [PATCH] dumpcap: check return value from adding interface
  2024-10-27 18:28 [PATCH] dumpcap: check return value from adding interface Stephen Hemminger
  2024-10-27 20:25 ` Morten Brørup
@ 2024-10-28  0:00 ` fengchengwen
  2024-10-30 14:09 ` David Marchand
  2 siblings, 0 replies; 4+ messages in thread
From: fengchengwen @ 2024-10-28  0:00 UTC (permalink / raw)
  To: Stephen Hemminger, dev

Acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2024/10/28 2:28, Stephen Hemminger wrote:
> The rte_pcapng_add_interface could fail.
> For example: running out of space for the file.
> 
> Covertity issue: 446742
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


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

* Re: [PATCH] dumpcap: check return value from adding interface
  2024-10-27 18:28 [PATCH] dumpcap: check return value from adding interface Stephen Hemminger
  2024-10-27 20:25 ` Morten Brørup
  2024-10-28  0:00 ` fengchengwen
@ 2024-10-30 14:09 ` David Marchand
  2 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2024-10-30 14:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Morten Brørup, Chengwen Feng

On Sun, Oct 27, 2024 at 7:29 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The rte_pcapng_add_interface could fail.
> For example: running out of space for the file.
>
> Covertity issue: 446742

Coverity*

> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2024-10-30 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-27 18:28 [PATCH] dumpcap: check return value from adding interface Stephen Hemminger
2024-10-27 20:25 ` Morten Brørup
2024-10-28  0:00 ` fengchengwen
2024-10-30 14:09 ` David Marchand

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).