diff options
author | Isaac Boukris <iboukris@gmail.com> | 2024-03-07 14:37:59 -0800 |
---|---|---|
committer | Thomas Monjalon <thomas@monjalon.net> | 2024-03-18 04:08:43 +0100 |
commit | b4f865bef153c4130f24394e83c8d3aeffa1d036 (patch) | |
tree | 397c013fece439c9189367797439dba9a20ba81c /app | |
parent | d692cb6c8ce7fa8c6c2d34978482707d69c90bd7 (diff) |
app/dumpcap: fix promiscuous mode disabling at exit
If request to set promiscuous mode failed at startup,
then it is not necessary to disable it when shutting down.
This should only be issue if with a buggy driver because if
driver does not support setting promiscuous it would just
ignore request to disable it as well.
Fixes: 6026bfae07d4 ("app/dumpcap: support multiple interfaces")
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'app')
-rw-r--r-- | app/dumpcap/main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index d57db0589a..cc0f66b2bc 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -828,12 +828,9 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp) if (rte_eth_promiscuous_get(intf->port) == 1) { /* promiscuous already enabled */ intf->opts.promisc_mode = false; - } else { - ret = rte_eth_promiscuous_enable(intf->port); - if (ret != 0) - fprintf(stderr, - "port %u set promiscuous enable failed: %d\n", - intf->port, ret); + } else if (rte_eth_promiscuous_enable(intf->port) < 0) { + fprintf(stderr, "port %u:%s set promiscuous failed\n", + intf->port, intf->name); intf->opts.promisc_mode = false; } } |