-O3 warnings be gone
[vpp.git] / vnet / vnet / ethernet / arp.c
index 446c76a..3eb6a11 100644 (file)
@@ -21,6 +21,8 @@
 #include <vnet/l2/l2_input.h>
 #include <vppinfra/mhash.h>
 
+void vl_api_rpc_call_main_thread (void *fp, u8 * data, u32 data_length);
+
 typedef struct {
   u32 sw_if_index;
   u32 fib_index;
@@ -1136,14 +1138,17 @@ show_ip4_arp (vlib_main_t * vm,
 
   es = 0;
   pool_foreach (e, am->ip4_entry_pool, ({ vec_add1 (es, e[0]); }));
-  vec_sort_with_function (es, ip4_arp_entry_sort);
-  vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, 0);
-  vec_foreach (e, es) {
-    if (sw_if_index != ~0 && e->key.sw_if_index != sw_if_index)
-      continue;
-    vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, e);
-  }
-  vec_free (es);
+  if ( es )
+    {
+      vec_sort_with_function (es, ip4_arp_entry_sort);
+      vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, 0);
+      vec_foreach (e, es) {
+        if (sw_if_index != ~0 && e->key.sw_if_index != sw_if_index)
+          continue;
+        vlib_cli_output (vm, "%U", format_ethernet_arp_ip4_entry, vnm, e);
+      }
+      vec_free (es);
+    }
 
   if (vec_len (am->proxy_arps))
     {
@@ -1241,6 +1246,10 @@ static clib_error_t * ethernet_arp_init (vlib_main_t * vm)
 {
   ethernet_arp_main_t * am = &ethernet_arp_main;
   pg_node_t * pn;
+  clib_error_t * error;
+
+  if ((error = vlib_call_init_function (vm, ethernet_init)))
+    return error;
 
   ethernet_register_input_type (vm, ETHERNET_TYPE_ARP, arp_input_node.index);
 
@@ -1744,7 +1753,7 @@ arp_term_l2bd (vlib_main_t * vm,
          ip0 = arp0->ip4_over_ethernet[1].ip4.as_u32;
          bd_index0 = vnet_buffer(p0)->l2.bd_index;
          if (PREDICT_FALSE (
-           (bd_index0 != last_bd_index) || (last_bd_index == ~0)))
+           (bd_index0 != last_bd_index) || (last_bd_index == (u16) ~0)))
            {
              last_bd_index = bd_index0;
              last_bd_config = vec_elt_at_index(l2im->bd_configs, bd_index0);