bonding: print the name on the cli when created 20/20420/4
authorMohsin Kazmi <sykazmi@cisco.com>
Mon, 1 Jul 2019 09:08:20 +0000 (11:08 +0200)
committerDamjan Marion <dmarion@me.com>
Wed, 24 Jul 2019 12:03:43 +0000 (12:03 +0000)
Type: feature

Change-Id: Icd718c98ba2fa900cafaf1a59dfb100ee9914ec9
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
src/vnet/bonding/cli.c

index ec779e2..9d3b942 100644 (file)
@@ -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;
 }