Fix stat seg average vector rate computation
[vpp.git] / src / vnet / ip / ip6_neighbor.c
index ded5b86..4f9e082 100755 (executable)
@@ -264,7 +264,7 @@ ip6_neighbor_get_link_local_address (u32 sw_if_index)
 
 /**
  * @brief publish wildcard arp event
- * @param sw_if_index The interface on which the ARP entires are acted
+ * @param sw_if_index The interface on which the ARP entries are acted
  */
 static int
 vnet_nd_wc_publish (u32 sw_if_index,
@@ -687,7 +687,7 @@ ip6_ethernet_update_adjacency (vnet_main_t * vnm, u32 sw_if_index, u32 ai)
         * Complete the remaining fields of the adj's rewrite to direct the
         * complete of the rewrite at switch time by copying in the IP
         * dst address's bytes.
-        * Ofset is 2 bytes into the desintation address.
+        * Ofset is 2 bytes into the destintation address.
         */
        offset = vec_len (rewrite) - 2;
        adj_mcast_update_rewrite (ai, rewrite, offset);
@@ -1021,6 +1021,10 @@ show_ip6_neighbors (vlib_main_t * vm,
   ip6_neighbor_t *n, *ns;
   clib_error_t *error = 0;
   u32 sw_if_index;
+  int verbose = 0;
+
+  if (unformat (input, "verbose"))
+    verbose = 1;
 
   /* Filter entries by interface if given. */
   sw_if_index = ~0;
@@ -1029,13 +1033,29 @@ show_ip6_neighbors (vlib_main_t * vm,
   ns = ip6_neighbors_entries (sw_if_index);
   if (ns)
     {
-      vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, 0);
-      vec_foreach (n, ns)
-      {
-       vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, n);
-      }
+      /*
+       * Show the entire table if it's not too big, otherwise just
+       * show the size of the table.
+       */
+      if (vec_len (ns) < 50)
+       verbose = 1;
+      if (verbose)
+       {
+         vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, 0);
+         vec_foreach (n, ns)
+         {
+           vlib_cli_output (vm, "%U", format_ip6_neighbor_ip6_entry, vm, n);
+         }
+       }
+      else
+       vlib_cli_output
+         (vm, "There are %u ip6 neighbors, "
+          "'show ip6 neighbors verbose' to display the entire table...",
+          vec_len (ns));
       vec_free (ns);
     }
+  else
+    vlib_cli_output (vm, "No ip6 neighbors");
 
   return error;
 }
@@ -4483,7 +4503,7 @@ ip6_neighbor_add_del_interface_address (ip6_main_t * im,
   ip6_radv_t *radv_info;
   ip6_address_t a;
 
-  /* create solicited node multicast address for this interface adddress */
+  /* create solicited node multicast address for this interface address */
   ip6_set_solicited_node_multicast_address (&a, 0);
 
   a.as_u8[0xd] = address->as_u8[0xd];