Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
NTPsec
ntpsec
Compare Revisions
66458e4b627f4aae85dd5e0902f80da2f6cba6a3...5613ab384a1fa2001f17512762f8d90b413431bf
Commits (3)
Try 4 times to get Nonce. Don't give up on first failure.
· caab6983
Gary E. Miller
authored
Aug 09, 2017
"If at first you do not suceed, try, try again."
caab6983
INSTALL: typo.
· 28b2f8da
Gary E. Miller
authored
Aug 09, 2017
28b2f8da
ntpmon detail mode styling
· 5613ab38
Gary E. Miller
authored
Aug 09, 2017
5613ab38
Hide whitespace changes
Inline
Side-by-side
INSTALL
View file @
5613ab38
...
...
@@ -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 pro
i
bably 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
...
...
ntpclients/ntpmon
View file @
5613ab38
...
...
@@ -139,16 +139,17 @@ def peer_detail(variables, showunits=False):
peerfmt
=
"""
\
%(adr)s
leap=%(leap)s
\t
reftime=%(reftime)s
\t
rootdelay=%(rootdelay)s
stratum=%(stratum)2d
\
t
rec=%(rec)s
\
t
rootdisp=%(rootdisp)s
precision=%(precision)3d
\
t
xmt=%(xmt)s
\
t
dispersion=%(dispersion)s
reftime=%(reftime)s
\
t
leap=%(leap)s
\
t
rootdelay=%(rootdelay)s
rec=%(rec)s
\t
stratum=%(stratum)2d
\t
rootdisp=%(rootdisp)s
xmt=%(xmt)s
\t
precision=%(precision)3d
\t
dispersion=%(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
):
...
...
pylib/packet.py
View file @
5613ab38
...
...
@@ -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"
...
...