aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-11 05:34:50 -0700
committerNeale Ranns <nranns@cisco.com>2019-03-12 12:13:58 -0400
commita6562a22e40688cc97cb1ec97a59706d02c40082 (patch)
tree9dd5388ae7ab82c60d629cb7d57fdb3882661bdc /src/vnet/fib/fib_api.c
parent43e7d25d9f91dd44b4779358095a3f54ab4f3029 (diff)
FIB: path parsing, table-id not fib-index (VPP-1586)
Change-Id: Ib27952935393163eaabf005c69b1cbc2feca2b98 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_api.c')
-rw-r--r--src/vnet/fib/fib_api.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c
index 3c832eb01fb..1a7d6fde573 100644
--- a/src/vnet/fib/fib_api.c
+++ b/src/vnet/fib/fib_api.c
@@ -55,10 +55,20 @@ fib_path_api_parse (const vl_api_fib_path_t *in,
out->frp_proto = in->afi;
// .frp_addr = (NULL == next_hop ? zero_addr : *next_hop),
out->frp_sw_if_index = ntohl(in->sw_if_index);
- out->frp_fib_index = ntohl(in->table_id);
out->frp_weight = in->weight;
out->frp_preference = in->preference;
+ if (DPO_PROTO_IP4 == out->frp_proto ||
+ DPO_PROTO_IP6 == out->frp_proto ||
+ DPO_PROTO_MPLS == out->frp_proto)
+ {
+ out->frp_fib_index = fib_table_find (dpo_proto_to_fib(out->frp_proto),
+ ntohl (in->table_id));
+
+ if (~0 == out->frp_fib_index)
+ return (VNET_API_ERROR_NO_SUCH_FIB);
+ }
+
/*
* the special INVALID label meams we are not recursing via a
* label. Exp-null value is never a valid via-label so that