X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fmpls%2Fmpls.c;h=05361de505d1ebb9cd9810eb102845d538b6d05c;hb=2e31cc35ca5db7f16c8052578d79f1ec84c0acb5;hp=173771477de4014621c29621f330cb13114e5706;hpb=70ed8aeff30c0eece0e19f0ad26c4cc8957278ae;p=vpp.git diff --git a/src/vnet/mpls/mpls.c b/src/vnet/mpls/mpls.c index 173771477de..05361de505d 100644 --- a/src/vnet/mpls/mpls.c +++ b/src/vnet/mpls/mpls.c @@ -47,6 +47,9 @@ u8 * format_mpls_unicast_label (u8 * s, va_list * args) case MPLS_IETF_GAL_LABEL: s = format (s, "%s", MPLS_IETF_GAL_STRING); break; + case MPLS_LABEL_POP: + s = format (s, "pop"); + break; default: s = format (s, "%d", label); break; @@ -225,7 +228,7 @@ vnet_mpls_local_label (vlib_main_t * vm, eos = MPLS_EOS; is_del = 0; local_label = MPLS_LABEL_INVALID; - memset(&pfx, 0, sizeof(pfx)); + clib_memset(&pfx, 0, sizeof(pfx)); payload_proto = DPO_PROTO_MPLS; /* Get a line of input. */ @@ -271,7 +274,7 @@ vnet_mpls_local_label (vlib_main_t * vm, ; else { - error = clib_error_return (0, "unkown input: %U", + error = clib_error_return (0, "unknown input: %U", format_unformat_error, line_input); goto done; } @@ -309,7 +312,6 @@ vnet_mpls_local_label (vlib_main_t * vm, else { fib_node_index_t fib_index; - u32 fi; if (NULL == rpaths) { @@ -322,24 +324,6 @@ vnet_mpls_local_label (vlib_main_t * vm, pfx.fp_label = local_label; pfx.fp_payload_proto = rpaths[0].frp_proto; - /* - * the CLI parsing stored table Ids, swap to FIB indicies - */ - if (FIB_NODE_INDEX_INVALID == rpath.frp_sw_if_index) - { - fi = fib_table_find(dpo_proto_to_fib(pfx.fp_payload_proto), - rpaths[0].frp_fib_index); - - if (~0 == fi) - { - error = clib_error_return(0 , "%U Via table %d does not exist", - format_dpo_proto, pfx.fp_payload_proto, - rpaths[0].frp_fib_index); - goto done; - } - rpaths[0].frp_fib_index = fi; - } - fib_index = mpls_fib_index_from_table_id(table_id); if (FIB_NODE_INDEX_INVALID == fib_index) @@ -384,9 +368,9 @@ done: } VLIB_CLI_COMMAND (mpls_local_label_command, static) = { - .path = "mpls local-label [eos|non-eos] via [next-hop-address] [next-hop-interface] [next-hop-table ] [weight ] [preference ] [udp-encap-id ] [ip4-lookup-in-table ] [ip6-lookup-in-table ] [mpls-lookup-in-table ] [resolve-via-host] [resolve-via-connected] [rx-ip4 ] [out-labels ]", + .path = "mpls local-label", .function = vnet_mpls_local_label, - .short_help = "Create/Delete MPLS local labels", + .short_help = "mpls local-label [add|del] [eos|non-eos] via [next-hop-address] [next-hop-interface] [next-hop-table ] [weight ] [preference ] [udp-encap-id ] [ip4-lookup-in-table ] [ip6-lookup-in-table ] [mpls-lookup-in-table ] [resolve-via-host] [resolve-via-attached] [rx-ip4 ] [out-labels ]", }; clib_error_t *