diff options
author | Neale Ranns <neale@graphiant.com> | 2021-12-20 18:18:42 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-12-21 11:13:41 +0000 |
commit | 53962fbccb4612af41e3fbd913cc50be09d3b24a (patch) | |
tree | b576686d35593d8e20b8f858eed4585ae3e8ff65 /src/vnet/fib/fib_path.c | |
parent | 3aa3d6d3f347784f3df5c164b3078bdc5e80e54a (diff) |
fib: MPLS EOS chains built for attached prefixes should link to a lookup DPO
Type: fix
Presently a local label associated with an attached or connected prefix will link to the glean. This is a problem since it will never use the adj-fibs that are installed for that attached prefix. Instead link the local label to a lookup in the table in which the attached link is bound.
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Iad49fb6168b9ba47216a9a52bd262363b49c3c43
Diffstat (limited to 'src/vnet/fib/fib_path.c')
-rw-r--r-- | src/vnet/fib/fib_path.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c index d7b6091325b..e4ad8770449 100644 --- a/src/vnet/fib/fib_path.c +++ b/src/vnet/fib/fib_path.c @@ -2421,6 +2421,7 @@ fib_path_stack_mpls_disp (fib_node_index_t path_index, void fib_path_contribute_forwarding (fib_node_index_t path_index, fib_forward_chain_type_t fct, + dpo_proto_t payload_proto, dpo_id_t *dpo) { fib_path_t *path; @@ -2428,7 +2429,6 @@ fib_path_contribute_forwarding (fib_node_index_t path_index, path = fib_path_get(path_index); ASSERT(path); - ASSERT(FIB_FORW_CHAIN_TYPE_MPLS_EOS != fct); /* * The DPO stored in the path was created when the path was resolved. @@ -2446,9 +2446,19 @@ fib_path_contribute_forwarding (fib_node_index_t path_index, case FIB_PATH_TYPE_ATTACHED_NEXT_HOP: switch (fct) { + case FIB_FORW_CHAIN_TYPE_MPLS_EOS: { + dpo_id_t tmp = DPO_INVALID; + dpo_copy (&tmp, dpo); + path = fib_path_attached_next_hop_get_adj( + path, + dpo_proto_to_link(payload_proto), + &tmp); + dpo_copy (dpo, &tmp); + dpo_reset(&tmp); + break; + } case FIB_FORW_CHAIN_TYPE_UNICAST_IP4: case FIB_FORW_CHAIN_TYPE_UNICAST_IP6: - case FIB_FORW_CHAIN_TYPE_MPLS_EOS: case FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS: case FIB_FORW_CHAIN_TYPE_ETHERNET: case FIB_FORW_CHAIN_TYPE_NSH: @@ -2560,10 +2570,25 @@ fib_path_contribute_forwarding (fib_node_index_t path_index, case FIB_PATH_TYPE_ATTACHED: switch (fct) { + case FIB_FORW_CHAIN_TYPE_MPLS_EOS: + /* + * End of stack traffic via an attacehd path (a glean) + * must forace an IP lookup so that the IP packet can + * match against any installed adj-fibs + */ + lookup_dpo_add_or_lock_w_fib_index( + fib_table_get_index_for_sw_if_index( + dpo_proto_to_fib(payload_proto), + path->attached.fp_interface), + payload_proto, + LOOKUP_UNICAST, + LOOKUP_INPUT_DST_ADDR, + LOOKUP_TABLE_FROM_CONFIG, + dpo); + break; case FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS: case FIB_FORW_CHAIN_TYPE_UNICAST_IP4: case FIB_FORW_CHAIN_TYPE_UNICAST_IP6: - case FIB_FORW_CHAIN_TYPE_MPLS_EOS: case FIB_FORW_CHAIN_TYPE_ETHERNET: case FIB_FORW_CHAIN_TYPE_NSH: case FIB_FORW_CHAIN_TYPE_BIER: @@ -2609,8 +2634,8 @@ fib_path_contribute_forwarding (fib_node_index_t path_index, /* * Create the adj needed for sending IP multicast traffic */ - interface_rx_dpo_add_or_lock(fib_forw_chain_type_to_dpo_proto(fct), - path->attached.fp_interface, + interface_rx_dpo_add_or_lock(payload_proto, + path->intf_rx.fp_interface, dpo); break; case FIB_PATH_TYPE_UDP_ENCAP: @@ -2630,6 +2655,7 @@ fib_path_contribute_forwarding (fib_node_index_t path_index, load_balance_path_t * fib_path_append_nh_for_multipath_hash (fib_node_index_t path_index, fib_forward_chain_type_t fct, + dpo_proto_t payload_proto, load_balance_path_t *hash_key) { load_balance_path_t *mnh; @@ -2646,7 +2672,7 @@ fib_path_append_nh_for_multipath_hash (fib_node_index_t path_index, if (fib_path_is_resolved(path_index)) { - fib_path_contribute_forwarding(path_index, fct, &mnh->path_dpo); + fib_path_contribute_forwarding(path_index, fct, payload_proto, &mnh->path_dpo); } else { |