[3/3] app/dumpcap: check for failure to set promiscious
Checks
Commit Message
If the rte_eth_promiscious_enable() fails, then log the error
and continue.
Coverity issue: 373662
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/dumpcap/main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
@@ -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 promicious enable faile: %d\n",
+ intf->port, ret);
+ }
ret = rte_pdump_enable_bpf(intf->port, RTE_PDUMP_ALL_QUEUES,
flags, snaplen,