]> The Tcpdump Group git mirrors - tcpdump/commitdiff
display cosmetics for printing NTP packets
authorhannes <hannes>
Wed, 28 Jan 2004 14:54:49 +0000 (14:54 +0000)
committerhannes <hannes>
Wed, 28 Jan 2004 14:54:49 +0000 (14:54 +0000)
print-ntp.c
print-udp.c

index fd5143bc19de236aa5835c10110e537ffe2e7b88..f9b65b2596abdfdab4156714c0742bd3cd65d5df 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.40 2004-01-28 14:34:50 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.41 2004-01-28 14:54:50 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -82,9 +82,6 @@ ntp_print(register const u_char *cp, u_int length)
        int mode, version, leapind;
 
        bp = (struct ntpdata *)cp;
-       /* Note funny sized packets */
-       if (length != sizeof(struct ntpdata))
-               (void)printf(" [len=%d]", length);
 
        TCHECK(bp->status);
 
index 27441c25eae16a69eb87f2d09494e862b0b59905..b9d409b95b5f9284f68e4f53b4f13ad40a52f46d 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.129 2003-11-19 00:19:56 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.130 2004-01-28 14:54:49 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -568,7 +568,7 @@ udp_print(register const u_char *bp, u_int length,
        }
        udpipaddr_print(ip, sport, dport);
 
-       if (IP_V(ip) == 4 && vflag && !fragmented) {
+       if (IP_V(ip) == 4 && (vflag > 1) && !fragmented) {
                int sum = up->uh_sum;
                if (sum == 0) {
                        (void)printf("[no cksum] ");
@@ -678,9 +678,9 @@ udp_print(register const u_char *bp, u_int length,
                         dport == BFD_ECHO_PORT )
                        bfd_print((const u_char *)(up+1), length, dport);
                else
-                       (void)printf("UDP, length: %u",
+                       (void)printf("UDP, length %u",
                            (u_int32_t)(ulen - sizeof(*up)));
 #undef ISPORT
        } else
-               (void)printf("UDP, length: %u", (u_int32_t)(ulen - sizeof(*up)));
+               (void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up)));
 }