[PATCH 1/2] pcapng: fix handling of chained mbufs

Stephen Hemminger stephen at networkplumber.org
Fri Sep 13 17:25:20 CEST 2024


On Fri, 13 Sep 2024 15:19:18 +0300
Oleksandr Nahnybida <oleksandrn at interfacemasters.com> wrote:

> The pcapng generates corrupted files when dealing with chained mbufs.
> This issue arises because in rte_pcapng_copy the length of the EPB block
> is incorrectly calculated using the data_len of the first mbuf instead
> of the pkt_len, despite that rte_pcapng_write_packets correctly writing
> the mbuf chain to disk.
> 
> This fix ensures that the block length is calculated based on the pkt_len,
> aligning it with the actual data written to disk.
> 
> Signed-off-by: Oleksandr Nahnybida <oleksandrn at interfacemaster.com>


Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files")

Reviewed-by: Stephen Hemminger <stephen at networkplumber.org>


More information about the dev mailing list