[PATCH v3] pcapng: fix write more packets than IOV_MAX limit
Thomas Monjalon
thomas at monjalon.net
Mon Oct 10 02:40:52 CEST 2022
01/08/2022 17:33, Stephen Hemminger:
> On Mon, 1 Aug 2022 10:40:56 +0200
> Mário Kuka <kuka at 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: stephen at networkplumber.org
+ Cc: stable at dpdk.org
> >
> > Signed-off-by: Mário Kuka <kuka at cesnet.cz>
>
> Thanks for fixing this.
>
> Acked-by: Stephen Hemminger <stephen at networkplumber.org>
Applied, thanks.
More information about the stable
mailing list