[PATCH] app/dumpcap:fix coredump problem because pcap_dump 3th argument is null

Stephen Hemminger stephen at networkplumber.org
Fri Mar 1 04:36:14 CET 2024


On Fri,  1 Mar 2024 18:41:29 +0800
Tianli Lai <laitianli at tom.com> wrote:

> if rte_pktmbuf_read() return NULL, pcap_dump() would coredump.
> 
> Signed-off-by: Tianli Lai <laitianli at tom.com>

Ok, but how is this possible.
	header.caplen will be min of (pktlen, 2048)

So in rte_pktmbuf_read()
	if (likely (0 + pktlen <= rte_pktmbuf_data_len(m))
		return rte_pktmbuf_mtod_offset(m, char *, 0);

Maybe the packet is really big and the packet is multi-segment.
But in that case the code rte_pktmbuf_read should do the consoliation.
Are you sure driver is not generating weird packets?


More information about the dev mailing list