patch 'app/dumpcap: handle SIGTERM and SIGHUP' has been queued to stable release 21.11.8
Kevin Traynor
ktraynor at redhat.com
Fri Aug 23 18:19:16 CEST 2024
Hi,
FYI, your patch has been queued to stable release 21.11.8
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/28/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/052fe1c82c7e6937a718ab8bc7afc51043cb83fc
Thanks.
Kevin
---
>From 052fe1c82c7e6937a718ab8bc7afc51043cb83fc Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 3 Jul 2024 08:45:43 -0700
Subject: [PATCH] app/dumpcap: handle SIGTERM and SIGHUP
[ upstream commit b04d11bdc672cf8afb7a544077303a941a6a2baa ]
If the dumpcap is killed it does not cleanup which leaves
the ring buffer and the memory pool behind.
Until resource are exhausted devices will continue to fill the ring.
Fix by having the application handle SIGTERM, SIGHUP, and SIGPIPE.
These are the same signals handled in same way by the wireshark
dumpcap application.
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/dumpcap/main.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 44576bed42..1025598b6d 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -790,4 +790,9 @@ int main(int argc, char **argv)
struct rte_ring *r;
struct rte_mempool *mp;
+ struct sigaction action = {
+ .sa_flags = SA_RESTART,
+ .sa_handler = signal_handler,
+ };
+ struct sigaction origaction;
dumpcap_out_t out;
char *p;
@@ -815,6 +820,11 @@ int main(int argc, char **argv)
enable_pdump(r, mp);
- signal(SIGINT, signal_handler);
- signal(SIGPIPE, SIG_IGN);
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGTERM, &action, NULL);
+ sigaction(SIGINT, &action, NULL);
+ sigaction(SIGPIPE, &action, NULL);
+ sigaction(SIGHUP, NULL, &origaction);
+ if (origaction.sa_handler == SIG_DFL)
+ sigaction(SIGHUP, &action, NULL);
enable_primary_monitor();
--
2.46.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-23 17:18:13.543726498 +0100
+++ 0128-app-dumpcap-handle-SIGTERM-and-SIGHUP.patch 2024-08-23 17:18:09.891430703 +0100
@@ -1 +1 @@
-From b04d11bdc672cf8afb7a544077303a941a6a2baa Mon Sep 17 00:00:00 2001
+From 052fe1c82c7e6937a718ab8bc7afc51043cb83fc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b04d11bdc672cf8afb7a544077303a941a6a2baa ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index b25b95e2fc..ba91ca94d0 100644
+index 44576bed42..1025598b6d 100644
@@ -26 +27 @@
-@@ -937,4 +937,9 @@ int main(int argc, char **argv)
+@@ -790,4 +790,9 @@ int main(int argc, char **argv)
@@ -36,2 +37,2 @@
-@@ -962,6 +967,11 @@ int main(int argc, char **argv)
- compile_filters();
+@@ -815,6 +820,11 @@ int main(int argc, char **argv)
+ enable_pdump(r, mp);
More information about the stable
mailing list