From: Ben Magistro <konce...@gmail.com>

When dumpcap adds an interface, the port was not being preserved. This
results in the structure being initialized and the port field being set
to 0 regardless of what port was actually selected. This unset field is
then used in both the enable and cleanup calls. This could result in the
capture occurring on the wrong interface.

Fixes: d59fb4d ("app/dumpcap: add new packet capture application")
Cc: step...@networkplumber.org
Cc: sta...@dpdk.org

Signed-off-by: Ben Magistro <konce...@gmail.com>
Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 app/dumpcap/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 2eb8414efaa5..4751ca26b892 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -202,6 +202,7 @@ static void add_interface(uint16_t port, const char *name)
                rte_exit(EXIT_FAILURE, "no memory for interface\n");
 
        memset(intf, 0, sizeof(*intf));
+       intf->port = port;
        rte_strscpy(intf->name, name, sizeof(intf->name));
 
        printf("Capturing on '%s'\n", name);
-- 
2.39.0

Reply via email to