diff options
author | Neale Ranns <nranns@cisco.com> | 2017-06-09 12:41:00 -0700 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2017-06-10 15:15:38 +0000 |
commit | 76481d0994b84d62eca35173140ae306b1ce5e34 (patch) | |
tree | 38e2ba56a711ff777bc537cdcc18d2f8f39974fa /src/vnet/mpls | |
parent | 27b390e87d0c46400c8a4034b441077f3443dfe1 (diff) |
MPLS: cannot delete a path from the CLI
Change-Id: I7f85870ef99405727312a5de6839c8875c9fa1c5
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mpls')
-rw-r--r-- | src/vnet/mpls/mpls.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/vnet/mpls/mpls.c b/src/vnet/mpls/mpls.c index a67f47a2..068d31f4 100644 --- a/src/vnet/mpls/mpls.c +++ b/src/vnet/mpls/mpls.c @@ -428,7 +428,7 @@ vnet_mpls_local_label (vlib_main_t * vm, } else { - fib_node_index_t lfe, fib_index; + fib_node_index_t fib_index; u32 fi; if (NULL == rpaths) @@ -469,19 +469,31 @@ vnet_mpls_local_label (vlib_main_t * vm, goto done; } - lfe = fib_table_entry_path_add2(fib_index, - &pfx, - FIB_SOURCE_CLI, - FIB_ENTRY_FLAG_NONE, - rpaths); - - if (FIB_NODE_INDEX_INVALID == lfe) + if (is_del) { - error = clib_error_return (0, "Failed to create %U-%U in MPLS table-id %d", - format_mpls_unicast_label, local_label, - format_mpls_eos_bit, eos, - table_id); - goto done; + fib_table_entry_path_remove2(fib_index, + &pfx, + FIB_SOURCE_CLI, + rpaths); + } + else + { + fib_node_index_t lfe; + + lfe = fib_table_entry_path_add2(fib_index, + &pfx, + FIB_SOURCE_CLI, + FIB_ENTRY_FLAG_NONE, + rpaths); + + if (FIB_NODE_INDEX_INVALID == lfe) + { + error = clib_error_return (0, "Failed to create %U-%U in MPLS table-id %d", + format_mpls_unicast_label, local_label, + format_mpls_eos_bit, eos, + table_id); + goto done; + } } } |