mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 18:14:29 +08:00
print-ntp.c: Add and use VERSIONSHIFT
Add shift constant VERSIONSHIFT(3), and use it in ntp_print().
This commit is contained in:
parent
8cdb42601b
commit
b1ee9bac52
@ -141,6 +141,7 @@ struct ntpdata {
|
||||
*/
|
||||
#define NTPVERSION_1 0x08
|
||||
#define VERSIONMASK 0x38
|
||||
#define VERSIONSHIFT 3
|
||||
#define LEAPMASK 0xc0
|
||||
#ifdef MODEMASK
|
||||
#undef MODEMASK /* Solaris sucks */
|
||||
@ -212,7 +213,7 @@ ntp_print(netdissect_options *ndo,
|
||||
|
||||
ND_TCHECK(bp->status);
|
||||
|
||||
version = (int)(bp->status & VERSIONMASK) >> 3;
|
||||
version = (int)(bp->status & VERSIONMASK) >> VERSIONSHIFT;
|
||||
ND_PRINT((ndo, "NTPv%d", version));
|
||||
|
||||
mode = bp->status & MODEMASK;
|
||||
|
Loading…
Reference in New Issue
Block a user