bonding: print the name on the cli when created
Type: feature
@@ -422,6 +422,7 @@ bond_create_if (vlib_main_t * vm, bond_create_if_args_t * args)
// for return
args->sw_if_index = bif->sw_if_index;
+ args->rv = 0;
}
static clib_error_t *
@@ -439,6 +440,7 @@ bond_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
args.id = ~0;
args.mode = -1;
args.lb = BOND_LB_L2;
+ args.rv = -1;
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "mode %U", unformat_bond_mode, &args.mode))
@@ -471,6 +473,10 @@ bond_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
bond_create_if (vm, &args);
+ if (!args.rv)
+ vlib_cli_output (vm, "%U\n", format_vnet_sw_if_index_name,
+ vnet_get_main (), args.sw_if_index);
+
return args.error;
}
