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.tanv...@emumba.com>
Signed-off-by: Stephen Hemminger <step...@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

Reply via email to