]> The Tcpdump Group git mirrors - tcpdump/commitdiff
PTP: Fix fetching the domainNumber
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 20 Apr 2020 17:44:37 +0000 (19:44 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 20 Apr 2020 17:44:37 +0000 (19:44 +0200)
print-ptp.c

index 6f762dc7c42094a52877232bd4fec3b916033f3d..36001c106f6d9ce8c4dc8993dab8f75080533ff5 100644 (file)
@@ -358,7 +358,7 @@ static void ptp_print_2(netdissect_options *ndo, const u_char *bp, u_int length)
     len -= 2; bp += 2; msg_len = GET_BE_U_2(bp); ND_PRINT(", length : %u", msg_len);
 
     /* domain */
-    len -= 2; bp += 2; domain_no = GET_BE_U_2(bp) & PTP_DOMAIN_MASK; ND_PRINT(", domain : %u", domain_no);
+    len -= 2; bp += 2; domain_no = (GET_BE_U_2(bp) & PTP_DOMAIN_MASK) >> 8; ND_PRINT(", domain : %u", domain_no);
 
     /* rsvd 1*/
     rsvd1 = GET_BE_U_2(bp) & PTP_RSVD1_MASK;