ip4: don't format upper layer if it's a fragment 34/18134/2
authorfaicker.mo <faicker.mo@ucloud.cn>
Wed, 14 Nov 2018 08:51:34 +0000 (16:51 +0800)
committerNeale Ranns <nranns@cisco.com>
Sun, 14 Apr 2019 23:48:58 +0000 (23:48 +0000)
Parsing ipv4 upper layer is not meaningful
if it's a fragment packet except the first.

Change-Id: I442fb7ec01244fde8c4f7656a8ba633d0aa0f97e
Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn>
src/vnet/ip/ip4_format.c

index 5399e44..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. */