diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2021-08-16 16:13:40 +0200 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2021-09-13 13:54:59 +0000 |
commit | 7854b46f7789aae662f01fc29f4dd222a67bfe3d (patch) | |
tree | 607736025d42db84ac52558a08d18ba5431987b0 /src/plugins | |
parent | 006bbc4945bc7df58c3e631f5626acb2555aa171 (diff) |
interface: fix init fib_index_by_sw_if_index
Type: fix
The init of fib_index_by_sw_if_index wasn't
setting default value to 0. Which we now
need for setting interfaces unnumbered
Change-Id: Ie5be9b5e5373ef055557a871ad4d1c45fbfc1dee
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lisp/lisp-gpe/interface.c | 2 | ||||
-rw-r--r-- | src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c | 2 | ||||
-rw-r--r-- | src/plugins/unittest/bier_test.c | 2 | ||||
-rw-r--r-- | src/plugins/unittest/fib_test.c | 12 | ||||
-rw-r--r-- | src/plugins/unittest/mfib_test.c | 8 |
5 files changed, 0 insertions, 26 deletions
diff --git a/src/plugins/lisp/lisp-gpe/interface.c b/src/plugins/lisp/lisp-gpe/interface.c index 1d2abaf3f90..d73471d6b3d 100644 --- a/src/plugins/lisp/lisp-gpe/interface.c +++ b/src/plugins/lisp/lisp-gpe/interface.c @@ -507,13 +507,11 @@ lisp_gpe_iface_set_table (u32 sw_if_index, u32 table_id) fib_index = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP4, table_id, FIB_SOURCE_LISP); - vec_validate (ip4_main.fib_index_by_sw_if_index, sw_if_index); ip4_main.fib_index_by_sw_if_index[sw_if_index] = fib_index; ip4_sw_interface_enable_disable (sw_if_index, 1); fib_index = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP6, table_id, FIB_SOURCE_LISP); - vec_validate (ip6_main.fib_index_by_sw_if_index, sw_if_index); ip6_main.fib_index_by_sw_if_index[sw_if_index] = fib_index; ip6_sw_interface_enable_disable (sw_if_index, 1); } diff --git a/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c b/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c index 9c48c0064ca..aea84a3fa92 100644 --- a/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c +++ b/src/plugins/lisp/lisp-gpe/lisp_gpe_sub_interface.c @@ -93,14 +93,12 @@ lisp_gpe_sub_interface_set_table (u32 sw_if_index, u32 table_id) FIB_SOURCE_LISP); ASSERT (FIB_NODE_INDEX_INVALID != fib_index); - vec_validate (ip4_main.fib_index_by_sw_if_index, sw_if_index); ip4_main.fib_index_by_sw_if_index[sw_if_index] = fib_index; fib_index = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP6, table_id, FIB_SOURCE_LISP); ASSERT (FIB_NODE_INDEX_INVALID != fib_index); - vec_validate (ip6_main.fib_index_by_sw_if_index, sw_if_index); ip6_main.fib_index_by_sw_if_index[sw_if_index] = fib_index; } diff --git a/src/plugins/unittest/bier_test.c b/src/plugins/unittest/bier_test.c index 9b4ba67e7cd..f1f9e03f461 100644 --- a/src/plugins/unittest/bier_test.c +++ b/src/plugins/unittest/bier_test.c @@ -134,8 +134,6 @@ bier_test_mk_intf (u32 ninterfaces) tm->hw[i] = vnet_get_hw_interface(vnet_get_main(), tm->hw_if_indicies[i]); - vec_validate (ip4_main.fib_index_by_sw_if_index, tm->hw[i]->sw_if_index); - vec_validate (ip6_main.fib_index_by_sw_if_index, tm->hw[i]->sw_if_index); ip4_main.fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; ip6_main.fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; error = vnet_sw_interface_set_flags(vnet_get_main(), diff --git a/src/plugins/unittest/fib_test.c b/src/plugins/unittest/fib_test.c index 76b675bca83..f62f232580d 100644 --- a/src/plugins/unittest/fib_test.c +++ b/src/plugins/unittest/fib_test.c @@ -158,10 +158,6 @@ fib_test_mk_intf (u32 ninterfaces) VNET_HW_INTERFACE_FLAG_LINK_UP); tm->hw[i] = vnet_get_hw_interface(vnet_get_main(), tm->hw_if_indicies[i]); - vec_validate (ip4_main.fib_index_by_sw_if_index, - tm->hw[i]->sw_if_index); - vec_validate (ip6_main.fib_index_by_sw_if_index, - tm->hw[i]->sw_if_index); ip4_main.fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; ip6_main.fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; @@ -5341,7 +5337,6 @@ fib_test_ae (void) }, }; - vec_validate(im->fib_index_by_sw_if_index, tm->hw[0]->sw_if_index); im->fib_index_by_sw_if_index[tm->hw[0]->sw_if_index] = fib_index; dpo_drop = drop_dpo_get(DPO_PROTO_IP4); @@ -5888,8 +5883,6 @@ 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; @@ -6365,7 +6358,6 @@ fib_test_label (void) FIB_TEST((0 == adj_nbr_db_size()), "ADJ DB size is %d", adj_nbr_db_size()); - vec_validate(im->fib_index_by_sw_if_index, tm->hw[0]->sw_if_index); im->fib_index_by_sw_if_index[tm->hw[0]->sw_if_index] = fib_index; fib_table_entry_update_one_path(fib_index, &local0_pfx, @@ -6411,7 +6403,6 @@ fib_test_label (void) }, }; - vec_validate(im->fib_index_by_sw_if_index, tm->hw[1]->sw_if_index); im->fib_index_by_sw_if_index[tm->hw[1]->sw_if_index] = fib_index; fib_table_entry_update_one_path(fib_index, &local1_pfx, @@ -9136,9 +9127,6 @@ fib_test_inherit (void) 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; diff --git a/src/plugins/unittest/mfib_test.c b/src/plugins/unittest/mfib_test.c index c456d59d7db..373ea485969 100644 --- a/src/plugins/unittest/mfib_test.c +++ b/src/plugins/unittest/mfib_test.c @@ -139,17 +139,9 @@ mfib_test_mk_intf (u32 ninterfaces) VNET_HW_INTERFACE_FLAG_LINK_UP); tm->hw[i] = vnet_get_hw_interface(vnet_get_main(), tm->hw_if_indicies[i]); - vec_validate (ip4_main.fib_index_by_sw_if_index, - tm->hw[i]->sw_if_index); - vec_validate (ip6_main.fib_index_by_sw_if_index, - tm->hw[i]->sw_if_index); ip4_main.fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; ip6_main.fib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; - vec_validate (ip4_main.mfib_index_by_sw_if_index, - tm->hw[i]->sw_if_index); - vec_validate (ip6_main.mfib_index_by_sw_if_index, - tm->hw[i]->sw_if_index); ip4_main.mfib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; ip6_main.mfib_index_by_sw_if_index[tm->hw[i]->sw_if_index] = 0; |