c11 safe string handling support
[vpp.git] / src / plugins / mactime / mactime.c
index 06dda53..21857d4 100644 (file)
@@ -177,9 +177,11 @@ static void vl_api_mactime_enable_disable_t_handler
   mactime_main_t *mm = &mactime_main;
   int rv;
 
+  VALIDATE_SW_IF_INDEX (mp);
+
   rv = mactime_enable_disable (mm, ntohl (mp->sw_if_index),
                               (int) (mp->enable_disable));
-
+  BAD_SW_IF_INDEX_LABEL;
   REPLY_MACRO (VL_API_MACTIME_ENABLE_DISABLE_REPLY);
 }
 
@@ -197,7 +199,7 @@ mactime_send_create_entry_message (u8 * mac_address)
   am = &api_main;
   shmem_hdr = am->shmem_hdr;
   mp = vl_msg_api_alloc_as_if_client (sizeof (*mp));
-  memset (mp, 0, sizeof (*mp));
+  clib_memset (mp, 0, sizeof (*mp));
   mp->_vl_msg_id = ntohs (VL_API_MACTIME_ADD_DEL_RANGE + mm->msg_id_base);
   name = format (0, "mac-%U", format_mac_address, mac_address);
 
@@ -225,7 +227,7 @@ static void vl_api_mactime_add_del_range_t_handler
 
   feature_init (mm);
 
-  memset (&kv, 0, sizeof (kv));
+  clib_memset (&kv, 0, sizeof (kv));
   memcpy (&kv.key, mp->mac_address, sizeof (mp->mac_address));
 
   /* See if we have a lookup table entry for this src mac address */
@@ -239,7 +241,7 @@ static void vl_api_mactime_add_del_range_t_handler
       if (found == 0)
        {
          pool_get (mm->devices, dp);
-         memset (dp, 0, sizeof (*dp));
+         clib_memset (dp, 0, sizeof (*dp));
          vlib_validate_combined_counter (&mm->allow_counters,
                                          dp - mm->devices);
          vlib_zero_combined_counter (&mm->allow_counters, dp - mm->devices);