X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/121cd17c7dc1fb0ae2dd0e2e823b4824530314e0..refs/pull/1034/head:/print-zep.c diff --git a/print-zep.c b/print-zep.c index fd74368c..b18437f0 100644 --- a/print-zep.c +++ b/print-zep.c @@ -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));