From 62fe07c8e30a6ac718fe65528592fe6964d753fa Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 31 Oct 2017 12:28:22 -0700 Subject: MPLS disposition actions at the tail of unicast LSPs Change-Id: I8c42e26152f2ed1246f91b789887bfc923418bdf Signed-off-by: Neale Ranns --- src/vnet/fib/fib_entry_src.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/vnet/fib/fib_entry_src.c') diff --git a/src/vnet/fib/fib_entry_src.c b/src/vnet/fib/fib_entry_src.c index 667aa485f7c..214dafe9b8d 100644 --- a/src/vnet/fib/fib_entry_src.c +++ b/src/vnet/fib/fib_entry_src.c @@ -259,6 +259,23 @@ fib_entry_chain_type_fixup (const fib_entry_t *entry, return (dfct); } +static dpo_proto_t +fib_prefix_get_payload_proto (const fib_prefix_t *pfx) +{ + switch (pfx->fp_proto) + { + case FIB_PROTOCOL_IP4: + return (DPO_PROTO_IP4); + case FIB_PROTOCOL_IP6: + return (DPO_PROTO_IP6); + case FIB_PROTOCOL_MPLS: + return (pfx->fp_payload_proto); + } + + ASSERT(0); + return (DPO_PROTO_IP4); +} + static void fib_entry_src_get_path_forwarding (fib_node_index_t path_index, fib_entry_src_collect_forwarding_ctx_t *ctx) @@ -313,7 +330,7 @@ fib_entry_src_get_path_forwarding (fib_node_index_t path_index, ctx->fct), &nh->path_dpo); fib_path_stack_mpls_disp(path_index, - ctx->fib_entry->fe_prefix.fp_payload_proto, + fib_prefix_get_payload_proto(&ctx->fib_entry->fe_prefix), &nh->path_dpo); break; -- cgit 1.2.3-korg