[PATCH v2] app/pdump: exit if no device specified
Stephen Hemminger
stephen at networkplumber.org
Sat Jul 1 04:16:11 CEST 2023
Simpler version of earlier patch which had a good idea, was just
implemented with more code than necessary.
If no device is specified don't start the capture loop.
Reported-by: usman.tanveer <usman.tanveer at emumba.com>
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
app/pdump/main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index c94606275b28..7a1c7bdf6011 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -915,6 +915,9 @@ dump_packets(void)
int i;
unsigned int lcore_id = 0;
+ if (num_tuples == 0)
+ rte_exit(EXIT_FAILURE, "No device specified for capture\n");
+
if (!multiple_core_capture) {
printf(" core (%u), capture for (%d) tuples\n",
rte_lcore_id(), num_tuples);
--
2.39.2
More information about the dev
mailing list