FIB path dump: fix next-hop-table ID for recursive routes
Change-Id: I57b4ebca29c0b185770373e8878f89a9bd13b742
Signed-off-by: Neale Ranns <nranns@cisco.com>
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index b87ec93..9ee74aa 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -20148,17 +20148,19 @@
if (fp->afi == IP46_TYPE_IP6)
print (vam->ofp,
" weight %d, sw_if_index %d, is_local %d, is_drop %d, "
- "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U",
+ "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U, "
+ "next_hop_table %d",
ntohl (fp->weight), ntohl (fp->sw_if_index), fp->is_local,
fp->is_drop, fp->is_unreach, fp->is_prohibit, fp->afi,
- format_ip6_address, fp->next_hop);
+ format_ip6_address, fp->next_hop, ntohl (fp->table_id));
else if (fp->afi == IP46_TYPE_IP4)
print (vam->ofp,
" weight %d, sw_if_index %d, is_local %d, is_drop %d, "
- "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U",
+ "is_unreach %d, is_prohitbit %d, afi %d, next_hop %U, "
+ "next_hop_table %d",
ntohl (fp->weight), ntohl (fp->sw_if_index), fp->is_local,
fp->is_drop, fp->is_unreach, fp->is_prohibit, fp->afi,
- format_ip4_address, fp->next_hop);
+ format_ip4_address, fp->next_hop, ntohl (fp->table_id));
fp++;
}
}
diff --git a/src/vnet/fib/fib_api.c b/src/vnet/fib/fib_api.c
index cea54a2..eca5e61 100644
--- a/src/vnet/fib/fib_api.c
+++ b/src/vnet/fib/fib_api.c
@@ -241,8 +241,7 @@
out->afi = api_rpath->rpath.frp_proto;
fib_api_path_copy_next_hop (api_rpath, out);
- if (~0 == api_rpath->rpath.frp_sw_if_index &&
- ip46_address_is_zero(&api_rpath->rpath.frp_addr))
+ if (0 != api_rpath->rpath.frp_fib_index)
{
if ((DPO_PROTO_IP6 == api_rpath->rpath.frp_proto) ||
(DPO_PROTO_IP4 == api_rpath->rpath.frp_proto))
diff --git a/src/vnet/fib/fib_path.c b/src/vnet/fib/fib_path.c
index 687e716..2912c6a 100644
--- a/src/vnet/fib/fib_path.c
+++ b/src/vnet/fib/fib_path.c
@@ -2593,6 +2593,7 @@
api_rpath->rpath.frp_preference = path->fp_preference;
api_rpath->rpath.frp_proto = path->fp_nh_proto;
api_rpath->rpath.frp_sw_if_index = ~0;
+ api_rpath->rpath.frp_fib_index = 0;
api_rpath->dpo = path->fp_dpo;
switch (path->fp_type)
@@ -2618,6 +2619,7 @@
break;
case FIB_PATH_TYPE_RECURSIVE:
api_rpath->rpath.frp_addr = path->recursive.fp_nh.fp_ip;
+ api_rpath->rpath.frp_fib_index = path->recursive.fp_tbl_id;
break;
case FIB_PATH_TYPE_DVR:
api_rpath->rpath.frp_sw_if_index = path->dvr.fp_interface;