From 499b1cbcf9d376a1130550ee61461276c5138a1b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 10 Feb 2022 15:09:06 -0800 Subject: [PATCH] app/dumpcap: check for failure to set promiscuous If the rte_eth_promiscuous_enable() fails, then log the error and continue. Coverity issue: 373662 Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index c5fe440302..536ec64711 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -679,8 +679,13 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp) flags |= RTE_PDUMP_FLAG_PCAPNG; TAILQ_FOREACH(intf, &interfaces, next) { - if (promiscuous_mode) - rte_eth_promiscuous_enable(intf->port); + if (promiscuous_mode) { + ret = rte_eth_promiscuous_enable(intf->port); + if (ret != 0) + fprintf(stderr, + "port %u set promiscuous enable failed: %d\n", + intf->port, ret); + } ret = rte_pdump_enable_bpf(intf->port, RTE_PDUMP_ALL_QUEUES, flags, snaplen, -- 2.39.5