net/pcap: fix Rx with small buffers
authorDavid Marchand <david.marchand@redhat.com>
Thu, 25 Jul 2019 19:24:17 +0000 (21:24 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 25 Jul 2019 22:32:18 +0000 (00:32 +0200)
commit6653d812c6d47f02ec6562a6118254299b0ffd5c
tree3b474b01676cc39d2ebd681b930e0721d7897f8d
parent6a0276241d895f1da9428f368b3dde0acdf89629
net/pcap: fix Rx with small buffers

If the pkt pool contains only buffers smaller than the default headroom,
then the driver will compute an invalid buffer size (negative value cast
to an uint16_t).
Rely on the mbuf api to check how much space is available in the mbuf.

Fixes: 6eb0ae218a98 ("pcap: fix mbuf allocation")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/pcap/rte_eth_pcap.c