diff options
author | Paul Atkins <patkins@graphiant.com> | 2021-10-12 14:32:11 +0100 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-10-21 16:40:11 +0000 |
commit | 8e2b1b129815d3e631aa425ed37899c78ea24e65 (patch) | |
tree | 4df9608750ec288c2b0723467ff68528e62e8e9b /src/vnet | |
parent | bfa86084af0e4d0cc8ad8ccbeafe999b748a990e (diff) |
fib: respect mfib entry flags on create with paths
When an mfib entry was created with both paths and entry_flags then
the entry flags were being ignored. If there are no paths then the
flags were passed into mfib_table_entry_update, but in the case where
the entry didn't exist and there were paths and flags, the entry was
created within mfib_table_entry_paths_update() which used a default
of MFIB_ENTRY_FLAG_NONE.
Pass the flags through into the mfib_table_entry_paths_update fn. All
existing callers other than the create case will now pass in
MFIB_ENTRY_FLAG_NONE.
Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I256375ba2fa863a62a88474ce1ea6bf2accdd456
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/ip/ip_api.c | 5 | ||||
-rw-r--r-- | src/vnet/ip/lookup.c | 4 | ||||
-rw-r--r-- | src/vnet/mfib/.clang-format | 2 | ||||
-rw-r--r-- | src/vnet/mfib/ip4_mfib.c | 2 | ||||
-rw-r--r-- | src/vnet/mfib/ip6_mfib.c | 2 | ||||
-rw-r--r-- | src/vnet/mfib/mfib_table.c | 10 | ||||
-rw-r--r-- | src/vnet/mfib/mfib_table.h | 2 | ||||
-rw-r--r-- | src/vnet/vxlan-gbp/vxlan_gbp.c | 13 | ||||
-rw-r--r-- | src/vnet/vxlan-gpe/vxlan_gpe.c | 13 | ||||
-rw-r--r-- | src/vnet/vxlan/vxlan.c | 11 |
10 files changed, 37 insertions, 27 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c index 79c9dd61e11..e197057d8c5 100644 --- a/src/vnet/ip/ip_api.c +++ b/src/vnet/ip/ip_api.c @@ -979,9 +979,8 @@ mroute_add_del_handler (u8 is_add, { if (is_add) { - mfib_entry_index = - mfib_table_entry_paths_update (fib_index, prefix, - MFIB_SOURCE_API, rpaths); + mfib_entry_index = mfib_table_entry_paths_update ( + fib_index, prefix, MFIB_SOURCE_API, entry_flags, rpaths); } else { diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c index 2bb667bc65a..b678ce330c3 100644 --- a/src/vnet/ip/lookup.c +++ b/src/vnet/ip/lookup.c @@ -882,8 +882,8 @@ vnet_ip_mroute_cmd (vlib_main_t * vm, mfib_table_entry_path_remove (fib_index, &pfx, MFIB_SOURCE_CLI, rpaths); else - mfib_table_entry_path_update (fib_index, - &pfx, MFIB_SOURCE_CLI, rpaths); + mfib_table_entry_path_update (fib_index, &pfx, MFIB_SOURCE_CLI, + MFIB_ENTRY_FLAG_NONE, rpaths); } if (FIB_PROTOCOL_IP4 == pfx.fp_proto) diff --git a/src/vnet/mfib/.clang-format b/src/vnet/mfib/.clang-format new file mode 100644 index 00000000000..9d159247d51 --- /dev/null +++ b/src/vnet/mfib/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/src/vnet/mfib/ip4_mfib.c b/src/vnet/mfib/ip4_mfib.c index 206e451e95c..e71b7db7e5f 100644 --- a/src/vnet/mfib/ip4_mfib.c +++ b/src/vnet/mfib/ip4_mfib.c @@ -92,6 +92,7 @@ ip4_create_mfib_with_table_id (u32 table_id, mfib_table_entry_path_update(mfib_table->mft_index, &ip4_specials[ii], MFIB_SOURCE_SPECIAL, + MFIB_ENTRY_FLAG_NONE, &path); } @@ -151,6 +152,7 @@ ip4_mfib_interface_enable_disable (u32 sw_if_index, int is_enable) mfib_table_entry_path_update(mfib_index, &ip4_specials[ii], MFIB_SOURCE_SPECIAL, + MFIB_ENTRY_FLAG_NONE, &path); } else diff --git a/src/vnet/mfib/ip6_mfib.c b/src/vnet/mfib/ip6_mfib.c index de6cbf3d37c..ac0dd8275f3 100644 --- a/src/vnet/mfib/ip6_mfib.c +++ b/src/vnet/mfib/ip6_mfib.c @@ -183,6 +183,7 @@ ip6_create_mfib_with_table_id (u32 table_id, mfib_table_entry_path_update(mfib_table->mft_index, &pfx, MFIB_SOURCE_SPECIAL, + MFIB_ENTRY_FLAG_NONE, &path_for_us); })); @@ -255,6 +256,7 @@ ip6_mfib_interface_enable_disable (u32 sw_if_index, int is_enable) mfib_table_entry_path_update(mfib_index, &pfx, MFIB_SOURCE_SPECIAL, + MFIB_ENTRY_FLAG_NONE, &path); }); } diff --git a/src/vnet/mfib/mfib_table.c b/src/vnet/mfib/mfib_table.c index a6a82774794..bbb9b05674a 100644 --- a/src/vnet/mfib/mfib_table.c +++ b/src/vnet/mfib/mfib_table.c @@ -292,6 +292,7 @@ static fib_node_index_t mfib_table_entry_paths_update_i (u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, + mfib_entry_flags_t entry_flags, const fib_route_path_t *rpaths) { fib_node_index_t mfib_entry_index; @@ -306,7 +307,7 @@ mfib_table_entry_paths_update_i (u32 fib_index, source, prefix, MFIB_RPF_ID_NONE, - MFIB_ENTRY_FLAG_NONE, + entry_flags, INDEX_INVALID); mfib_entry_path_update(mfib_entry_index, source, rpaths); @@ -325,6 +326,7 @@ fib_node_index_t mfib_table_entry_path_update (u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, + mfib_entry_flags_t entry_flags, const fib_route_path_t *rpath) { fib_node_index_t mfib_entry_index; @@ -333,7 +335,8 @@ mfib_table_entry_path_update (u32 fib_index, vec_add1(rpaths, *rpath); mfib_entry_index = mfib_table_entry_paths_update_i(fib_index, prefix, - source, rpaths); + source, entry_flags, + rpaths); vec_free(rpaths); return (mfib_entry_index); @@ -343,10 +346,11 @@ fib_node_index_t mfib_table_entry_paths_update (u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, + mfib_entry_flags_t entry_flags, const fib_route_path_t *rpaths) { return (mfib_table_entry_paths_update_i(fib_index, prefix, - source, rpaths)); + source, entry_flags, rpaths)); } static void diff --git a/src/vnet/mfib/mfib_table.h b/src/vnet/mfib/mfib_table.h index 9a682b53a67..e3441342aaa 100644 --- a/src/vnet/mfib/mfib_table.h +++ b/src/vnet/mfib/mfib_table.h @@ -210,10 +210,12 @@ extern fib_node_index_t mfib_table_entry_update(u32 fib_index, extern fib_node_index_t mfib_table_entry_path_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, + mfib_entry_flags_t entry_flags, const fib_route_path_t *rpath); extern fib_node_index_t mfib_table_entry_paths_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, + mfib_entry_flags_t entry_flags, const fib_route_path_t *rpath); /** diff --git a/src/vnet/vxlan-gbp/vxlan_gbp.c b/src/vnet/vxlan-gbp/vxlan_gbp.c index 1a1d2c2ba08..eb685b8a40c 100644 --- a/src/vnet/vxlan-gbp/vxlan_gbp.c +++ b/src/vnet/vxlan-gbp/vxlan_gbp.c @@ -571,17 +571,16 @@ int vnet_vxlan_gbp_tunnel_add_del * - the forwarding interface is for-us * - the accepting interface is that from the API */ - mfib_table_entry_path_update (t->encap_fib_index, - &mpfx, - MFIB_SOURCE_VXLAN_GBP, &path); + mfib_table_entry_path_update (t->encap_fib_index, &mpfx, + MFIB_SOURCE_VXLAN_GBP, + MFIB_ENTRY_FLAG_NONE, &path); path.frp_sw_if_index = a->mcast_sw_if_index; path.frp_flags = FIB_ROUTE_PATH_FLAG_NONE; path.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT; - mfei = mfib_table_entry_path_update (t->encap_fib_index, - &mpfx, - MFIB_SOURCE_VXLAN_GBP, - &path); + mfei = mfib_table_entry_path_update ( + t->encap_fib_index, &mpfx, MFIB_SOURCE_VXLAN_GBP, + MFIB_ENTRY_FLAG_NONE, &path); /* * Create the mcast adjacency to send traffic to the group diff --git a/src/vnet/vxlan-gpe/vxlan_gpe.c b/src/vnet/vxlan-gpe/vxlan_gpe.c index 17ffcadcd9f..8ef94d44337 100644 --- a/src/vnet/vxlan-gpe/vxlan_gpe.c +++ b/src/vnet/vxlan-gpe/vxlan_gpe.c @@ -645,17 +645,16 @@ int vnet_vxlan_gpe_add_del_tunnel * - the forwarding interface is for-us * - the accepting interface is that from the API */ - mfib_table_entry_path_update (t->encap_fib_index, - &mpfx, - MFIB_SOURCE_VXLAN_GPE, &path); + mfib_table_entry_path_update (t->encap_fib_index, &mpfx, + MFIB_SOURCE_VXLAN_GPE, + MFIB_ENTRY_FLAG_NONE, &path); path.frp_sw_if_index = a->mcast_sw_if_index; path.frp_flags = FIB_ROUTE_PATH_FLAG_NONE; path.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT; - mfei = mfib_table_entry_path_update (t->encap_fib_index, - &mpfx, - MFIB_SOURCE_VXLAN_GPE, - &path); + mfei = mfib_table_entry_path_update ( + t->encap_fib_index, &mpfx, MFIB_SOURCE_VXLAN_GPE, + MFIB_ENTRY_FLAG_NONE, &path); /* * Create the mcast adjacency to send traffic to the group diff --git a/src/vnet/vxlan/vxlan.c b/src/vnet/vxlan/vxlan.c index f62b9252377..8568d5b0a98 100644 --- a/src/vnet/vxlan/vxlan.c +++ b/src/vnet/vxlan/vxlan.c @@ -581,15 +581,16 @@ int vnet_vxlan_add_del_tunnel * - the forwarding interface is for-us * - the accepting interface is that from the API */ - mfib_table_entry_path_update (t->encap_fib_index, - &mpfx, MFIB_SOURCE_VXLAN, &path); + mfib_table_entry_path_update (t->encap_fib_index, &mpfx, + MFIB_SOURCE_VXLAN, + MFIB_ENTRY_FLAG_NONE, &path); path.frp_sw_if_index = a->mcast_sw_if_index; path.frp_flags = FIB_ROUTE_PATH_FLAG_NONE; path.frp_mitf_flags = MFIB_ITF_FLAG_ACCEPT; - mfei = mfib_table_entry_path_update (t->encap_fib_index, - &mpfx, - MFIB_SOURCE_VXLAN, &path); + mfei = mfib_table_entry_path_update ( + t->encap_fib_index, &mpfx, MFIB_SOURCE_VXLAN, + MFIB_ENTRY_FLAG_NONE, &path); /* * Create the mcast adjacency to send traffic to the group |