From 8c2f05c2dc5d87f64ce03916d1b8341ec0397b15 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 12 Dec 2016 19:35:58 +0000 Subject: IP and MPLS route debug CLI fixes Change-Id: I1b61f36c88308c1bcf9a61a87843d1fea457d8fe Signed-off-by: Neale Ranns --- vnet/vnet/ip/lookup.c | 9 +++++++++ vnet/vnet/mpls/mpls.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/vnet/vnet/ip/lookup.c b/vnet/vnet/ip/lookup.c index 126deef7dd0..734a4cd7cfb 100644 --- a/vnet/vnet/ip/lookup.c +++ b/vnet/vnet/ip/lookup.c @@ -542,6 +542,15 @@ vnet_ip_route_cmd (vlib_main_t * vm, rpath.frp_sw_if_index = ~0; vec_add1 (rpaths, rpath); } + else if (vec_len (prefixs) > 0 && + unformat (line_input, "via %U", + unformat_vnet_sw_interface, vnm, + &rpath.frp_sw_if_index)) + { + rpath.frp_weight = 1; + rpath.frp_proto = prefixs[0].fp_proto; + vec_add1 (rpaths, rpath); + } else if (vec_len (prefixs) > 0 && unformat (line_input, "via %U", unformat_dpo, &dpo, prefixs[0].fp_proto)) diff --git a/vnet/vnet/mpls/mpls.c b/vnet/vnet/mpls/mpls.c index e6ae4980067..c3e642a649c 100644 --- a/vnet/vnet/mpls/mpls.c +++ b/vnet/vnet/mpls/mpls.c @@ -418,7 +418,7 @@ vnet_mpls_local_label (vlib_main_t * vm, pfx.fp_proto = FIB_PROTOCOL_MPLS; pfx.fp_len = 21; pfx.fp_label = local_label; - pfx.fp_payload_proto = DPO_PROTO_MPLS; + pfx.fp_payload_proto = fib_proto_to_dpo(rpaths[0].frp_proto); if (NULL == rpaths) { @@ -437,7 +437,7 @@ vnet_mpls_local_label (vlib_main_t * vm, if (~0 == fi) { error = clib_error_return(0 , "%U Via table %d does not exist", - format_fib_protocol, pfx.fp_payload_proto, + format_dpo_proto, pfx.fp_payload_proto, rpaths[0].frp_fib_index); goto done; } -- cgit 1.2.3-korg