Skip to content

Commit

Permalink
app/pdump: exit if no device specified
Browse files Browse the repository at this point in the history
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@emumba.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
  • Loading branch information
shemminger authored and tmonjalo committed Jul 6, 2023
1 parent 6fd14c1 commit 8751ab5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/pdump/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8751ab5

Please sign in to comment.