From: Olivier Matz Date: Wed, 9 Nov 2016 13:08:26 +0000 (+0100) Subject: app/test: fix crash of LPM test X-Git-Tag: spdx-start~5329 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=dd030a0ee807471257f7e72a1673eacd4d7f0963;p=dpdk.git app/test: fix crash of LPM test The test recently added accesses to lpm->tbl8[ip >> 8] with is much larger than the size of the table, causing a crash of the test application. Fix this typo by replacing tbl8 by tbl24. Fixes: 231fa88ed522 ("app/test: verify LPM tbl8 recycle") Signed-off-by: Olivier Matz Acked-by: Wei Dai --- diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index 80e0efc5fc..41ae80fe16 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -1256,7 +1256,7 @@ test18(void) rte_lpm_add(lpm, ip, depth, next_hop); TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group); - tbl8_group_index = lpm->tbl8[ip>>8].group_idx; + tbl8_group_index = lpm->tbl24[ip>>8].group_idx; depth = 23; next_hop = 2; @@ -1272,7 +1272,7 @@ test18(void) rte_lpm_add(lpm, ip, depth, next_hop); TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group); - TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx); + TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl24[ip>>8].group_idx); depth = 24; next_hop = 4; @@ -1288,7 +1288,7 @@ test18(void) rte_lpm_add(lpm, ip, depth, next_hop); TEST_LPM_ASSERT(lpm->tbl24[ip>>8].valid_group); - TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl8[ip>>8].group_idx); + TEST_LPM_ASSERT(tbl8_group_index == lpm->tbl24[ip>>8].group_idx); rte_lpm_free(lpm); #undef group_idx