diff options
Diffstat (limited to 'src/vnet/fib/mpls_fib.c')
-rw-r--r-- | src/vnet/fib/mpls_fib.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/vnet/fib/mpls_fib.c b/src/vnet/fib/mpls_fib.c index 494d0106bae..767fc84c8a8 100644 --- a/src/vnet/fib/mpls_fib.c +++ b/src/vnet/fib/mpls_fib.c @@ -22,7 +22,7 @@ * packets. Whether the two actions are the same more often than they are * different, or vice versa, is a function of the deployment in which the router * is used and thus not predictable. - * The desgin choice to make with an MPLS_FIB table is: + * The design choice to make with an MPLS_FIB table is: * 1 - 20 bit key: label only. * When the EOS and non-EOS actions differ the result is a 'EOS-choice' object. * 2 - 21 bit key: label and EOS-bit. @@ -33,7 +33,7 @@ * - lower memory overhead, since there are few DB entries. * Disadvantages: * - slower DP performance in the case the chains differ, as more objects are - * encounterd in the switch path + * encountered in the switch path * * 21 bit key: * Advantages: @@ -275,6 +275,7 @@ mpls_fib_table_destroy (u32 fib_index) } hash_free(mf->mf_entries); + vec_free (fib_table->ft_locks); vec_free(fib_table->ft_src_route_counts); pool_put(mpls_main.mpls_fibs, mf); pool_put(mpls_main.fibs, fib_table); @@ -450,7 +451,7 @@ mpls_fib_show (vlib_main_t * vm, continue; s = format (s, "%v, fib_index:%d locks:[", - fib_table->ft_desc, mpls_main.fibs - fib_table); + fib_table->ft_desc, fib_table - mpls_main.fibs); vec_foreach_index(source, fib_table->ft_locks) { if (0 != fib_table->ft_locks[source]) @@ -480,3 +481,24 @@ VLIB_CLI_COMMAND (mpls_fib_show_command, static) = { .short_help = "show mpls fib [summary] [table <n>]", .function = mpls_fib_show, }; + +static clib_error_t * +mpls_config (vlib_main_t * vm, unformat_input_t * input) +{ + char *default_name = 0; + + while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (input, "default-table-name %s", &default_name)) + ; + else + return clib_error_return (0, "unknown input '%U'", + format_unformat_error, input); + } + + fib_table_default_names[FIB_PROTOCOL_MPLS] = default_name; + + return 0; +} + +VLIB_EARLY_CONFIG_FUNCTION (mpls_config, "mpls"); |