]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-zep.c
gre: add support for MikroTik Ethernet-over-IP hack.
[tcpdump] / print-zep.c
index fd74368ceb3b74f1217f049d2abd276ca8f147e9..b18437f0c784c8eb6d1a34f8f277a484a6e120e9 100644 (file)
@@ -77,20 +77,17 @@ static void zep_print_ts(netdissect_options *ndo, const u_char *p)
                                                billion */
        ND_PRINT("%u.%09d", i, f);
 
-#ifdef HAVE_STRFTIME
        /*
         * print the time in human-readable format.
         */
        if (i) {
                time_t seconds = i - JAN_1970;
-               struct tm *tm;
                char time_buf[128];
 
-               tm = localtime(&seconds);
-               strftime(time_buf, sizeof (time_buf), "%Y/%m/%d %H:%M:%S", tm);
-               ND_PRINT(" (%s)", time_buf);
+               ND_PRINT(" (%s)",
+                   nd_format_time(time_buf, sizeof (time_buf), "%Y/%m/%d %H:%M:%S",
+                     localtime(&seconds)));
        }
-#endif
 }
 
 /*
@@ -123,7 +120,7 @@ zep_print(netdissect_options *ndo,
 
        if (version == 1) {
                /* ZEP v1 packet. */
-               ND_LCHECK_U(len, 16);
+               ND_ICHECK_U(len, <, 16);
                ND_PRINT("Channel ID %u, Device ID 0x%04x, ",
                         GET_U_1(bp + 3), GET_BE_U_2(bp + 4));
                if (GET_U_1(bp + 6))
@@ -139,7 +136,7 @@ zep_print(netdissect_options *ndo,
                /* ZEP v2 packet. */
                if (GET_U_1(bp + 3) == 2) {
                        /* ZEP v2 ack. */
-                       ND_LCHECK_U(len, 8);
+                       ND_ICHECK_U(len, <, 8);
                        seq_no = GET_BE_U_4(bp + 4);
                        ND_PRINT("ACK, seq# = %u", seq_no);
                        inner_len = 0;
@@ -147,7 +144,7 @@ zep_print(netdissect_options *ndo,
                        len -= 8;
                } else {
                        /* ZEP v2 data, or some other. */
-                       ND_LCHECK_U(len, 32);
+                       ND_ICHECK_U(len, <, 32);
                        ND_PRINT("Type %u, Channel ID %u, Device ID 0x%04x, ",
                                 GET_U_1(bp + 3), GET_U_1(bp + 4),
                                 GET_BE_U_2(bp + 5));