Commits (3)
......@@ -120,7 +120,7 @@ On macOS you can use this command to turn off the Apple version of NTP:
sudo launchctl unload /System/Library/LaunchDaemons/org.ntp.ntpd.plist
----
Under Mac OS X 10.6.8 (Snow Leopard) and proibably older versions, you
Under Mac OS X 10.6.8 (Snow Leopard) and probably older versions, you
may find that configuration fails with a message about -o being an
unknown option. This is due to a bad interaction with waf. To work
around this, find your waflib/Tools/gcc.py under the waf temporary
......
......@@ -139,16 +139,17 @@ def peer_detail(variables, showunits=False):
peerfmt = """\
%(adr)s
leap=%(leap)s\treftime=%(reftime)s\trootdelay=%(rootdelay)s
stratum=%(stratum)2d\trec=%(rec)s\trootdisp=%(rootdisp)s
precision=%(precision)3d\txmt=%(xmt)s\tdispersion=%(dispersion)s
reftime=%(reftime)s\tleap=%(leap)s\trootdelay=%(rootdelay)s
rec=%(rec)s\tstratum=%(stratum)2d\trootdisp=%(rootdisp)s
xmt=%(xmt)s\tprecision=%(precision)3d\tdispersion=%(dispersion)s
unreach=%(unreach)d hmode=%(hmode)d pmode=%(pmode)d hpoll=%(hpoll)d \
ppoll=%(ppoll)d headway=%(headway)s flash=%(flash)s keyid=%(keyid)s
filtdelay = %(filtdelay)s
filtoffset = %(filtoffset)s
filtdisp = %(filtdisp)s
"""
return peerfmt % vcopy
str = peerfmt % vcopy
return str.expandtabs()
class Fatal(Exception):
......
......@@ -1338,14 +1338,21 @@ class ControlSession:
def fetch_nonce(self):
"""
Receive a nonce that can be replayed - combats source address spoofing
Ask for, and get, a nonce that can be replayed.
This combats source address spoofing
"""
self.doquery(opcode=ntp.control.CTL_OP_REQ_NONCE)
self.nonce_xmit = time.time()
if not self.response.startswith(polybytes("nonce=")):
print("## Nonce expected: %s" % self.response)
raise ControlException(SERR_BADNONCE)
return polystr(self.response.strip())
for i in range(3):
# retry 4 times
self.doquery(opcode=ntp.control.CTL_OP_REQ_NONCE)
self.nonce_xmit = time.time()
if self.response.startswith(polybytes("nonce=")):
return polystr(self.response.strip())
# maybe a delay between tries?
# uh, oh, no nonce seen
# this print probably never can be seen...
print("## Nonce expected: %s" % self.response)
raise ControlException(SERR_BADNONCE)
def mrulist(self, variables=None, rawhook=None, direct=None):
"Retrieve MRU list data"
......