]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ntp.c
Fix some "unsigned int" vs. "size_t" issues (they're not necessarily the
[tcpdump] / print-ntp.c
index fd5143bc19de236aa5835c10110e537ffe2e7b88..4960dc829c50b02eb2a0d95fc9d47e8b6a32f353 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.42 2005-05-06 07:56:53 guy 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);
 
@@ -136,7 +133,8 @@ ntp_print(register const u_char *cp, u_int length)
                break;
 
        case PRIM_REF:
-               fn_printn((u_char *)&(bp->refid), 4, NULL);
+               if (fn_printn((u_char *)&(bp->refid), 4, snapend))
+                       goto trunc;
                break;
 
        case INFO_QUERY: