]> 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, 27 Apr 2015 00:09:16 +0000 (17:09 -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 17816121a6c987261ab137db90e8689440729238..eddc771ca5b585b9501cbf678f095d7d975ade63 100644 (file)
@@ -96,7 +96,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",