]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ntp.c
Improve a tcpdump error message, free device list before exiting.
[tcpdump] / print-ntp.c
index 4b029172e7b871db4aab2385837535331d8c2f37..30bef73172e9d9907dcb6ce4c507eea6d8815cc5 100644 (file)
  * RFC 5905 - NTPv4
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
-#include <time.h>
-
 #include "netdissect.h"
 #include "addrtoname.h"
 #include "extract.h"
@@ -178,7 +174,7 @@ static const struct tok ntp_leapind_values[] = {
 
 static const struct tok ntp_stratum_values[] = {
        { UNSPECIFIED,  "unspecified" },
-       { PRIM_REF,     "primary reference" },
+       { PRIM_REF,     "primary reference" },
        { 0, NULL }
 };
 
@@ -306,9 +302,9 @@ ntp_time_print(netdissect_options *ndo,
        p_ntp_delta(ndo, &(bp->org_timestamp), &(bp->xmt_timestamp));
 
        /* FIXME: this code is not aware of any extension fields */
-       if (length == NTP_TIMEMSG_MINLEN + 4) {         /* Optional: key-id (crypto-NAK) */
+       if (length == NTP_TIMEMSG_MINLEN + 4) { /* Optional: key-id (crypto-NAK) */
                ND_PRINT("\n\tKey id: %u", GET_BE_U_4(bp->key_id));
-       } else if (length == NTP_TIMEMSG_MINLEN + 4 + 16) {     /* Optional: key-id + 128-bit digest */
+       } else if (length == NTP_TIMEMSG_MINLEN + 4 + 16) {     /* Optional: key-id + 128-bit digest */
                ND_PRINT("\n\tKey id: %u", GET_BE_U_4(bp->key_id));
                ND_TCHECK_LEN(bp->message_digest, 16);
                ND_PRINT("\n\tAuthentication: %08x%08x%08x%08x",
@@ -316,7 +312,7 @@ ntp_time_print(netdissect_options *ndo,
                         GET_BE_U_4(bp->message_digest + 4),
                         GET_BE_U_4(bp->message_digest + 8),
                         GET_BE_U_4(bp->message_digest + 12));
-       } else if (length == NTP_TIMEMSG_MINLEN + 4 + 20) {     /* Optional: key-id + 160-bit digest */
+       } else if (length == NTP_TIMEMSG_MINLEN + 4 + 20) {     /* Optional: key-id + 160-bit digest */
                ND_PRINT("\n\tKey id: %u", GET_BE_U_4(bp->key_id));
                ND_TCHECK_LEN(bp->message_digest, 20);
                ND_PRINT("\n\tAuthentication: %08x%08x%08x%08x%08x",