On Mon, 1 Aug 2022 10:40:56 +0200 Mário Kuka <k...@cesnet.cz> wrote:
> The rte_pcapng_write_packets() function fails when we try to write more > packets than the IOV_MAX limit. writev() system call is limited by the > IOV_MAX limit. The iovcnt argument is valid if it is greater than 0 and > less than or equal to IOV_MAX as defined in <limits.h>. > > To avoid this problem, we can check that all segments of the next > packet will fit into the iovec buffer, whose capacity will be limited > by the IOV_MAX limit. If not, we flush the current iovec buffer to the > file by calling writev() and, if successful, fit the current packet at > the beginning of the flushed iovec buffer. > > Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files") > Cc: step...@networkplumber.org > > Signed-off-by: Mário Kuka <k...@cesnet.cz> Thanks for fixing this. Acked-by: Stephen Hemminger <step...@networkplumber.org>