]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix heuristic not to be byte-order-dependent.
authorGuy Harris <[email protected]>
Mon, 27 Apr 2015 00:09:16 +0000 (17:09 -0700)
committerGuy Harris <[email protected]>
Mon, 4 May 2015 01:02:04 +0000 (18:02 -0700)
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.

print-udp.c

index c3edf6ef5de19b855731cd0c30bf07ab6a2d0275..7e44f999f7638606ace8884002559f9030b13979 100644 (file)
@@ -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",