summaryrefslogtreecommitdiffstats
path: root/src/plugins/unittest/fib_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/unittest/fib_test.c')
-rw-r--r--src/plugins/unittest/fib_test.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c
index b9b77ba479f..c6291fb2658 100644
--- a/src/plugins/unittest/fib_test.c
+++ b/src/plugins/unittest/fib_test.c
@@ -5869,10 +5869,14 @@ fib_test_ae (void)
static int
fib_test_pref (void)
{
- test_main_t *tm = &test_main;
- int res;
+ test_main_t *tm;
+ ip4_main_t *im;
+ int res, i;
+ tm = &test_main;
+ im = &ip4_main;
res = 0;
+
const fib_prefix_t pfx_1_1_1_1_s_32 = {
.fp_len = 32,
.fp_proto = FIB_PROTOCOL_IP4,
@@ -5883,6 +5887,11 @@ fib_test_pref (void)
},
};
+ vec_validate(im->fib_index_by_sw_if_index, tm->hw[2]->sw_if_index);
+
+ for (i = 0; i <= 2; i++)
+ im->fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0;
+
/*
* 2 high, 2 medium and 2 low preference non-recursive paths
*/
@@ -9049,12 +9058,25 @@ static int
fib_test_inherit (void)
{
fib_node_index_t fei;
+ int n_feis, res, i;
test_main_t *tm;
- int n_feis, res;
+ ip4_main_t *im4;
+ ip6_main_t *im6;
+ tm = &test_main;
+ im4 = &ip4_main;
+ im6 = &ip6_main;
res = 0;
+
+ vec_validate(im4->fib_index_by_sw_if_index, tm->hw[2]->sw_if_index);
+ vec_validate(im6->fib_index_by_sw_if_index, tm->hw[2]->sw_if_index);
+
+ for (i = 0; i <= 2; i++)
+ {
+ im4->fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0;
+ im6->fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0;
+ }
n_feis = fib_entry_pool_size();
- tm = &test_main;
const ip46_address_t nh_10_10_10_1 = {
.ip4.as_u32 = clib_host_to_net_u32(0x0a0a0a01),