]> git.droids-corp.org - dpdk.git/commitdiff
app/dumpcap: check for failure to set promiscuous
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 10 Feb 2022 23:09:06 +0000 (15:09 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 8 Mar 2022 08:19:46 +0000 (09:19 +0100)
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 <stephen@networkplumber.org>
app/dumpcap/main.c

index c5fe4403028aaf0432aa313d44cc5b2f620110a3..536ec64711ea449ea33a4dd2b431b11a9ddbfb68 100644 (file)
@@ -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,