From: Yongseok Koh Date: Wed, 27 Dec 2017 03:51:38 +0000 (-0800) Subject: app/testpmd: fix crash of txonly with multiple segments X-Git-Tag: spdx-start~755 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b03913e9e22fbd7206c3d266b0f52831eacd96b3;p=dpdk.git app/testpmd: fix crash of txonly with multiple segments Running txonly mode can crash with "--txpkts=20,470". copy_len should be properly adjusted. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh Acked-by: Wenzhuo Lu --- diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index 9bd3ce7ee5..da758f8123 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -75,6 +75,7 @@ copy_buf_to_pkt_segs(void* buf, unsigned len, struct rte_mbuf *pkt, buf = ((char*) buf + copy_len); seg = seg->next; seg_buf = rte_pktmbuf_mtod(seg, char *); + copy_len = seg->data_len; } rte_memcpy(seg_buf, buf, (size_t) len); }