linux-cp: ignore neighbors if ip addr is multicast
[vpp.git] / src / plugins / memif / cli.c
index f2c8829..19f624a 100644 (file)
@@ -53,6 +53,7 @@ memif_socket_filename_create_command_fn (vlib_main_t * vm,
       else
        {
          vec_free (socket_filename);
+         unformat_free (line_input);
          return clib_error_return (0, "unknown input `%U'",
                                    format_unformat_error, input);
        }
@@ -125,6 +126,7 @@ memif_socket_filename_delete_command_fn (vlib_main_t * vm,
        ;
       else
        {
+         unformat_free (line_input);
          return clib_error_return (0, "unknown input `%U'",
                                    format_unformat_error, input);
        }
@@ -213,8 +215,11 @@ memif_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
                         unformat_ethernet_address, args.hw_addr))
        args.hw_addr_set = 1;
       else
-       return clib_error_return (0, "unknown input `%U'",
-                                 format_unformat_error, input);
+       {
+         unformat_free (line_input);
+         return clib_error_return (0, "unknown input `%U'",
+                                   format_unformat_error, input);
+       }
     }
   unformat_free (line_input);
 
@@ -266,22 +271,6 @@ VLIB_CLI_COMMAND (memif_create_command, static) = {
 };
 /* *INDENT-ON* */
 
-static clib_error_t *
-create_memif_command_fn (vlib_main_t * vm, unformat_input_t * input,
-                        vlib_cli_command_t * cmd)
-{
-  vlib_cli_output (vm, "command deprecated. Please use "
-                  "'create interface memif' instead.\n");
-  return 0;
-}
-
-/* *INDENT-OFF* */
-VLIB_CLI_COMMAND (create_memif_command, static) = {
-  .path = "create memif",
-  .function = create_memif_command_fn,
-};
-/* *INDENT-ON* */
-
 static clib_error_t *
 memif_delete_command_fn (vlib_main_t * vm, unformat_input_t * input,
                         vlib_cli_command_t * cmd)
@@ -305,8 +294,11 @@ memif_delete_command_fn (vlib_main_t * vm, unformat_input_t * input,
                         vnm, &sw_if_index))
        ;
       else
-       return clib_error_return (0, "unknown input `%U'",
-                                 format_unformat_error, input);
+       {
+         unformat_free (line_input);
+         return clib_error_return (0, "unknown input `%U'",
+                                   format_unformat_error, input);
+       }
     }
   unformat_free (line_input);
 
@@ -314,7 +306,7 @@ memif_delete_command_fn (vlib_main_t * vm, unformat_input_t * input,
     return clib_error_return (0,
                              "please specify interface name or sw_if_index");
 
-  hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
+  hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
   if (hw == NULL || memif_device_class.index != hw->dev_class_index)
     return clib_error_return (0, "not a memif interface");
 
@@ -394,23 +386,22 @@ format_memif_descriptor (u8 * s, va_list * args)
   if (ring)
     {
       s = format (s, "%Udescriptor table:\n", format_white_space, indent);
-      s =
-       format (s,
-               "%Uid    flags   len         address       offset    user address\n",
-               format_white_space, indent);
-      s =
-       format (s,
-               "%U===== ===== ======== ================== ====== ==================\n",
-               format_white_space, indent);
+      s = format (s,
+                 "%Uid    flags region len         address         offset    "
+                 "    user address\n",
+                 format_white_space, indent);
+      s = format (s,
+                 "%U===== ===== ====== ======== ================== "
+                 "========== ==================\n",
+                 format_white_space, indent);
       for (slot = 0; slot < ring_size; slot++)
        {
-         s = format (s, "%U%-5d %-5d %-7d  0x%016lx %-6d 0x%016lx\n",
-                     format_white_space, indent, slot,
-                     ring->desc[slot].flags,
-                     ring->desc[slot].length,
+         s = format (s, "%U%-5d %-5d %-6d %-7d  0x%016lx %-10d 0x%016lx\n",
+                     format_white_space, indent, slot, ring->desc[slot].flags,
+                     ring->desc[slot].region, ring->desc[slot].length,
                      mif->regions[ring->desc[slot].region].shm,
-                     ring->desc[slot].offset, memif_get_buffer (mif, ring,
-                                                                slot));
+                     ring->desc[slot].offset,
+                     memif_get_buffer (mif, ring, slot));
        }
       s = format (s, "\n");
     }
@@ -477,9 +468,8 @@ memif_show_command_fn (vlib_main_t * vm, unformat_input_t * input,
   if (vec_len (hw_if_indices) == 0)
     {
       /* *INDENT-OFF* */
-      pool_foreach (mif, mm->interfaces,
+      pool_foreach (mif, mm->interfaces)
          vec_add1 (hw_if_indices, mif->hw_if_index);
-      );
       /* *INDENT-ON* */
     }