[dpdk-dev] [PATCH] pdump: initialize snaplen if enabled by device id

Stephen Hemminger stephen at networkplumber.org
Wed Oct 27 20:08:47 CEST 2021


If packet dump was enabled via pdump_enable_by_deviceid
the packet snapshot length was not being set.

Bugzilla ID: 840
Fixes: 10f726efe26c ("pdump: support pcapng and filtering")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 lib/pdump/rte_pdump.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index 71602685d544..3086b2a1688b 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -631,6 +631,9 @@ pdump_enable_by_deviceid(const char *device_id, uint16_t queue,
 	if (ret < 0)
 		return ret;
 
+	if (snaplen == 0)
+		snaplen = UINT32_MAX;
+
 	return pdump_prepare_client_request(device_id, queue, flags, snaplen,
 					    ENABLE, ring, mp, prm);
 }
-- 
2.30.2



More information about the dev mailing list