pcap: fix Rx crash
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Tue, 5 Aug 2014 10:18:20 +0000 (11:18 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 12 Aug 2014 23:27:53 +0000 (01:27 +0200)
commit7b4482e04bcabbfcfa3f47198e27c3b1bb4d1a94
treea9ae786b01100014e29dba7374b58105979b5f99
parent1589b64c358b94d96eef05cd82815249ec4b286e
pcap: fix Rx crash

Normally, bufs[i] stores the mbuf pointer, the index of buf[i]
is the loop count i, but if header.len > buf_size, DPDK will
free the mbuf, but the loop count i still increases, so some
of the items in bufs[] might be NULL pointer, causing a potential
DPDK core. Using num_rx as the index for bufs[] solves the problem.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Jiajia SunX <sunx.jiajia@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_pmd_pcap/rte_eth_pcap.c