The peer polling interval is an exponent; treat it as such.

RFC 1119 says

	Peer Poll Interval (peer.ppoll, pkt.ppoll): This is a signed
	    integer indicating the minimum interval between messages
	    sent by the peer, in seconds as a power of two.  For
	    instance, a alue of six indicates a minimum interval of 64
	    seconds.

so print both the raw value and 2^{raw value}, showing the latter.

Patch from Debian bug 686276.

Reviewed-By: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
peppe 2012-11-12 21:59:56 -08:00 committed by Guy Harris
parent 6ad73bbdf8
commit 6e3dfa3ca3

View File

@ -117,7 +117,7 @@ ntp_print(register const u_char *cp, u_int length)
tok2str(ntp_stratum_values, (bp->stratum >=2 && bp->stratum<=15) ? "secondary reference" : "reserved", bp->stratum));
TCHECK(bp->ppoll);
printf(", poll %us", bp->ppoll);
printf(", poll %u (%us)", bp->ppoll, 1 << bp->ppoll);
/* Can't TCHECK bp->precision bitfield so bp->distance + 0 instead */
TCHECK2(bp->root_delay, 0);