stats: Deprecate old stats framework
[vpp.git] / src / vpp / api / api.c
index 1f376dc..ed769d2 100644 (file)
@@ -102,9 +102,6 @@ memclnt_delete_callback (u32 client_index)
   vpe_api_main_t *vam = &vpe_api_main;
   vpe_client_registration_t *rp;
   uword *p;
-  int stats_memclnt_delete_callback (u32 client_index);
-
-  stats_memclnt_delete_callback (client_index);
 
 #define _(a)                                                    \
     p = hash_get (vam->a##_registration_hash, client_index);    \
@@ -219,7 +216,8 @@ vl_api_cli_inband_t_handler (vl_api_cli_inband_t * mp)
   u8 *out_vec = 0;
   u32 len = 0;
 
-  if (vl_msg_api_get_msg_length (mp) < vl_api_string_len (&mp->cmd))
+  if (vl_msg_api_get_msg_length (mp) <
+      vl_api_string_len (&mp->cmd) + sizeof (*mp))
     {
       rv = -1;
       goto error;
@@ -250,11 +248,10 @@ vl_api_show_version_t_handler (vl_api_show_version_t * mp)
   char *vpe_api_get_version (void);
   char *vpe_api_get_build_date (void);
 
-  u32 program_len = strnlen_s ("vpe", 32) + 1;
-  u32 version_len = strnlen_s (vpe_api_get_version (), 32) + 1;
-  u32 build_date_len = strnlen_s (vpe_api_get_build_date (), 32) + 1;
-  u32 build_directory_len =
-    strnlen_s (vpe_api_get_build_directory (), 256) + 1;
+  u32 program_len = strnlen_s ("vpe", 32);
+  u32 version_len = strnlen_s (vpe_api_get_version (), 32);
+  u32 build_date_len = strnlen_s (vpe_api_get_build_date (), 32);
+  u32 build_directory_len = strnlen_s (vpe_api_get_build_directory (), 256);
 
   u32 n = program_len + version_len + build_date_len + build_directory_len;