From: Francois-Xavier Le Bail Date: Mon, 30 Mar 2020 13:01:28 +0000 (+0200) Subject: PTP: Use GET_BE_U_6() calls for 6 bytes time stamps X-Git-Tag: tcpdump-4.99-bp~471 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/c339b579b913ca0134a9a84a19d3ccfe1ecfc41b PTP: Use GET_BE_U_6() calls for 6 bytes time stamps --- diff --git a/print-ptp.c b/print-ptp.c index 71a82042..6f762dc7 100644 --- a/print-ptp.c +++ b/print-ptp.c @@ -467,7 +467,7 @@ ptp_print_timestamp(netdissect_options *ndo, const u_char *bp, u_int *len, const ND_PRINT(", %s :", stype); /* sec time stamp 6 bytes */ - secs = GET_BE_U_2(bp) + GET_BE_U_4(bp+2); + secs = GET_BE_U_6(bp); ND_PRINT(" %"PRIu64" seconds,", secs); *len -= 6; bp += 6; @@ -489,7 +489,7 @@ ptp_print_timestamp_identity(netdissect_options *ndo, ND_PRINT(", %s :", ttype); /* sec time stamp 6 bytes */ - secs = GET_BE_U_2(bp) + GET_BE_U_4(bp+2); + secs = GET_BE_U_6(bp); ND_PRINT(" %"PRIu64" seconds,", secs); *len -= 6; bp += 6; @@ -523,7 +523,7 @@ ptp_print_announce_msg(netdissect_options *ndo, const u_char *bp, u_int *len) ND_PRINT(", %s :", p_origin_ts); /* sec time stamp 6 bytes */ - secs = GET_BE_U_2(bp) + GET_BE_U_4(bp+2); + secs = GET_BE_U_6(bp); ND_PRINT(" %"PRIu64" seconds", secs); *len -= 6; bp += 6;