api: clean up error message
[vpp.git] / src / vlibapi / api_shared.c
index bf03751..d2f1759 100644 (file)
@@ -813,6 +813,7 @@ vl_msg_api_queue_handler (svm_queue_t * q)
 
   while (!svm_queue_sub (q, (u8 *) &msg, SVM_Q_WAIT, 0))
     {
+      VL_MSG_API_UNPOISON ((u8 *) msg);
       msgbuf_t *msgbuf = (msgbuf_t *) ((u8 *) msg - offsetof (msgbuf_t, data));
       vl_msg_api_handler ((void *) msg, ntohl (msgbuf->data_len));
     }
@@ -1059,8 +1060,9 @@ vl_api_from_api_to_new_vec (void *mp, vl_api_string_t * astr)
   u8 *v = 0;
 
   if (vl_msg_api_max_length (mp) < clib_net_to_host_u32 (astr->length))
-    return format (0, "insane astr->length %u%c",
-                  clib_net_to_host_u32 (astr->length), 0);
+    return format (0, "Invalid astr->length %u > max (%u)%c",
+                  clib_net_to_host_u32 (astr->length),
+                  vl_msg_api_max_length (mp), 0);
   vec_add (v, astr->buf, clib_net_to_host_u32 (astr->length));
   return v;
 }