summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2019-10-08 09:33:46 -0700
committerDavid Marchand <david.marchand@redhat.com>2019-10-16 12:41:49 +0200
commit1636775425456d021b4ab0dd0b312edc8fbd78b8 (patch)
tree6037d1e417cd84eb7984c8bf91a0147d8fde60da /app
parenta2b5a8722f20265896cb1ac026c716239f6313bf (diff)
downloaddpdk-1636775425456d021b4ab0dd0b312edc8fbd78b8.zip
dpdk-1636775425456d021b4ab0dd0b312edc8fbd78b8.tar.gz
dpdk-1636775425456d021b4ab0dd0b312edc8fbd78b8.tar.xz
test/mbuf: fix forged mbuf in clone test
The test for cloning changed mbuf would generate an mbuf whose length and segments count were invalid. This would cause a crash if test was run with mbuf debugging enabled. Fixes: 4ccd2bb3a9e2 ("app/test: enhance mbuf refcnt check") Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'app')
-rw-r--r--app/test/test_mbuf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 2a97afe..aafad0c 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -332,8 +332,11 @@ testclone_testupdate_testdetach(struct rte_mempool *pktmbuf_pool)
m->next = rte_pktmbuf_alloc(pktmbuf_pool);
if (m->next == NULL)
GOTO_FAIL("Next Pkt Null\n");
+ m->nb_segs = 2;
rte_pktmbuf_append(m->next, sizeof(uint32_t));
+ m->pkt_len = 2 * sizeof(uint32_t);
+
data = rte_pktmbuf_mtod(m->next, unaligned_uint32_t *);
*data = MAGIC_DATA;