From: Guy Harris Date: Mon, 27 Apr 2015 00:09:16 +0000 (-0700) Subject: Fix heuristic not to be byte-order-dependent. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/e43a3462bb63d3f9140191b650ff2049f993fa9b Fix heuristic not to be byte-order-dependent. I'm *guessing* that the item being fetched is big-endian; the "vt" protocol might be old enough that they developed it on (non-Sun386i) Sun workstations, assuming they didn't just say "this is an Internet protocol, hence fields are big-endian"). That also prevents problems on platforms that don't support unaligned accesses. --- diff --git a/print-udp.c b/print-udp.c index c3edf6ef..7e44f999 100644 --- a/print-udp.c +++ b/print-udp.c @@ -97,7 +97,7 @@ static void vat_print(netdissect_options *ndo, const void *hdr, register const struct udphdr *up) { /* vat/vt audio */ - u_int ts = *(uint16_t *)hdr; + u_int ts = EXTRACT_16BITS(hdr); if ((ts & 0xf060) != 0) { /* probably vt */ ND_PRINT((ndo, "udp/vt %u %d / %d",