aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ip/lookup.c9
-rw-r--r--vnet/vnet/mpls/mpls.c4
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
@@ -544,6 +544,15 @@ vnet_ip_route_cmd (vlib_main_t * vm,
}
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))
{
vec_add1 (dpos, dpo);
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;
}