If pcap_sendpacket() fails, then eth_pcap_tx shouldn't silently free that mbuf and continue.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com> --- lib/librte_pmd_pcap/rte_eth_pcap.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c index dc4670c..6f026ab 100644 --- a/lib/librte_pmd_pcap/rte_eth_pcap.c +++ b/lib/librte_pmd_pcap/rte_eth_pcap.c @@ -239,8 +239,9 @@ eth_pcap_tx(void *queue, mbuf = bufs[i]; ret = pcap_sendpacket(tx_queue->pcap, (u_char*) mbuf->pkt.data, mbuf->pkt.data_len); - if(likely(!ret)) - num_tx++; + if (unlikely(ret != 0)) + break; + num_tx++; rte_pktmbuf_free(mbuf); } -- 1.7.7.6