Run interior graph nodes before process nodes
[vpp.git] / src / vlib / log.c
index aa6fe0c..25d0c4d 100644 (file)
@@ -142,6 +142,7 @@ vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt, ...)
   u8 *s = 0;
   bool use_formatted_log_entry = true;
 
+  vec_validate (lm->entries, lm->size);
   /* make sure we are running on the main thread to avoid use in dataplane
      code, for dataplane logging consider use of event-logger */
   ASSERT (vlib_get_thread_index () == 0);
@@ -399,11 +400,11 @@ unformat_vlib_log_level (unformat_input_t * input, va_list * args)
   vlib_log_level_t *level = va_arg (*args, vlib_log_level_t *);
   u8 *level_str = NULL;
   uword rv = 1;
-  if (unformat (input, "%v", &level_str))
+  if (unformat (input, "%s", &level_str))
     {
 #define _(v, uc, lc)                                   \
   const char __##uc[] = #lc;                           \
-  if (!memcmp (level_str, __##uc, sizeof (__##uc))) \
+  if (!strcmp ((const char *) level_str, __##uc))      \
     {                                                  \
       *level = VLIB_LOG_LEVEL_##uc;                 \
       rv = 1;                                          \