fib: fix crash while adding intf-rx routes
[vpp.git] / src / vnet / interface_format.c
index 1ef4704..f74a4ea 100644 (file)
@@ -120,7 +120,7 @@ format_vnet_hw_interface_link_speed (u8 * s, va_list * args)
 {
   u32 link_speed = va_arg (*args, u32);
 
-  if (link_speed == 0)
+  if (link_speed == 0 || link_speed == UINT32_MAX)
     return format (s, "unknown");
 
   if (link_speed >= 1000000)
@@ -290,7 +290,7 @@ format_vnet_sw_if_index_name (u8 * s, va_list * args)
 
   if (NULL == si)
     {
-      return format (s, "DELETED");
+      return format (s, "DELETED (%u)", sw_if_index);
     }
   return format (s, "%U", format_vnet_sw_interface_name, vnm, si);
 }
@@ -305,7 +305,7 @@ format_vnet_hw_if_index_name (u8 * s, va_list * args)
   hi = vnet_get_hw_interface (vnm, hw_if_index);
 
   if (hi == 0)
-    return format (s, "DELETED");
+    return format (s, "DELETED (%u)", hw_if_index);
 
   return format (s, "%v", hi->name);
 }
@@ -369,11 +369,11 @@ format_vnet_sw_interface_cntrs (u8 * s, vnet_interface_main_t * im,
       n_printed += 2;
 
       if (n)
-       _vec_len (n) = 0;
+       vec_set_len (n, 0);
       n = format (n, "%s packets", cm->name);
       s = format (s, "%-16v%16Ld", n, vtotal.packets);
 
-      _vec_len (n) = 0;
+      vec_set_len (n, 0);
       n = format (n, "%s bytes", cm->name);
       s = format (s, "\n%U%-16v%16Ld",
                  format_white_space, indent, n, vtotal.bytes);
@@ -602,9 +602,9 @@ format_vnet_buffer_opaque (u8 * s, va_list * args)
 
   s = format (s,
              "l2_classify.table_index: %d, l2_classify.opaque_index: %d, "
-             "l2_classify.hash: 0x%llx",
-             o->l2_classify.table_index,
-             o->l2_classify.opaque_index, o->l2_classify.hash);
+             "l2_classify.hash: 0x%lx",
+             o->l2_classify.table_index, o->l2_classify.opaque_index,
+             o->l2_classify.hash);
   vec_add1 (s, '\n');
 
   s = format (s, "policer.index: %d", o->policer.index);