ip4: don't format upper layer if it's a fragment
[vpp.git] / src / vnet / ip / ip4_format.c
index 0a2d7d2..6c31b42 100644 (file)
@@ -178,6 +178,9 @@ format_ip4_header (u8 * s, va_list * args)
        _(CONGESTION);
 #undef _
       }
+    /* Fragment packet but not the first. */
+    if (o != 0)
+      return s;
   }
 
   /* Recurse into next protocol layer. */
@@ -213,7 +216,7 @@ unformat_ip4_header (unformat_input_t * input, va_list * args)
     ip = p;
   }
 
-  memset (ip, 0, sizeof (ip[0]));
+  clib_memset (ip, 0, sizeof (ip[0]));
   ip->ip_version_and_header_length = IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS;
 
   if (!unformat (input, "%U: %U -> %U",