]> The Tcpdump Group git mirrors - tcpdump/commitdiff
print IP keyword plus optional version number
authorhannes <hannes>
Thu, 8 May 2003 14:26:54 +0000 (14:26 +0000)
committerhannes <hannes>
Thu, 8 May 2003 14:26:54 +0000 (14:26 +0000)
print-ip.c

index 981f233743a601905b5e92ab926a1962f68a53d7..19edb1a35339cba60fd3359d3863fc8dea8be0a9 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.121 2003-04-24 12:51:35 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.122 2003-05-08 14:26:54 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -369,6 +369,8 @@ ip_print(register const u_char *bp, register u_int length)
        u_int16_t sum, ip_sum;
        const char *sep = "";
 
+       printf("IP%s ", (((*bp >> 4) & 0xf) == 4) ? "" : "4"); /* print version if != 4 */
+
        ip = (const struct ip *)bp;
        if ((u_char *)(ip + 1) > snapend) {
                printf("[|ip]");