app/testpmd: fix packet headers in txonly mode
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Tue, 9 Apr 2019 09:45:47 +0000 (09:45 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 12 Apr 2019 09:02:02 +0000 (11:02 +0200)
Fix ether header size calculation in Tx only mode.

Coverity issue: 337684
Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/txonly.c

index 66e6378..2d0e1a0 100644 (file)
@@ -189,7 +189,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
        /*
         * Copy headers in first packet segment(s).
         */
-       copy_buf_to_pkt(eth_hdr, sizeof(eth_hdr), pkt, 0);
+       copy_buf_to_pkt(eth_hdr, sizeof(*eth_hdr), pkt, 0);
        copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt,
                        sizeof(struct ether_hdr));
        if (txonly_multi_flow) {