From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
stable@dpdk.org, Jerin Jacob <jerinj@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Zhirun Yan <yanzhirun_163@163.com>,
Amit Prakash Shukla <amitprakashs@marvell.com>
Subject: [PATCH 1/7] graph: fix double close of pcapng file
Date: Tue, 1 Dec 2026 14:41:34 -0800 [thread overview]
Message-ID: <20261201224258.1962108-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20261201224258.1962108-1-stephen@networkplumber.org>
If adding an interface to the capture file failed, the error path
called rte_pcapng_close(), which closes the file descriptor,
and then closed the same descriptor again.
Only close the descriptor directly if rte_pcapng_fdopen() failed.
Fixes: df5908c98abc ("graph: fix pcapng file support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/graph/graph_pcap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c
index 78859ec2d4..07678d967d 100644
--- a/lib/graph/graph_pcap.c
+++ b/lib/graph/graph_pcap.c
@@ -128,11 +128,13 @@ graph_pcap_file_open(const char *filename)
done:
return 0;
error:
+ /* once rte_pcapng_fdopen() succeeds, the fd is closed by rte_pcapng_close() */
if (pcapng_fd != NULL) {
rte_pcapng_close(pcapng_fd);
pcapng_fd = NULL;
+ } else {
+ close(fd);
}
- close(fd);
return -1;
}
--
2.53.0
next prev parent reply other threads:[~2026-12-01 22:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 22:41 [PATCH 0/7] pcapng: fixes, timestamps and stdio output Stephen Hemminger
2026-12-01 22:41 ` Stephen Hemminger [this message]
2026-12-01 22:41 ` [PATCH 2/7] pcapng: call writev as needed on highly segmented mbuf Stephen Hemminger
2026-12-01 22:41 ` [PATCH 3/7] eal: add function to convert TSC to epoch time Stephen Hemminger
2026-12-01 22:41 ` [PATCH 4/7] pcapng: use EAL TSC to epoch conversion Stephen Hemminger
2026-12-01 22:41 ` [PATCH 5/7] pcapng: add user-supplied timestamp support Stephen Hemminger
2026-12-01 22:41 ` [PATCH 6/7] test/pcapng: compare timestamps in one clock domain Stephen Hemminger
2026-12-01 22:41 ` [PATCH 7/7] pcapng: use stdio for output Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201224258.1962108-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=amitprakashs@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=stable@dpdk.org \
--cc=yanzhirun_163@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox