[Git][NTPsec/ntpsec][master] 2 commits: Avoid ever sending a stale nonce.

Eric S. Raymond gitlab at mg.gitlab.com
Tue Dec 20 16:26:43 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
bd92f8da by Eric S. Raymond at 2016-12-20T11:26:28-05:00
Avoid ever sending a stale nonce.

- - - - -
8ae36797 by Eric S. Raymond at 2016-12-20T11:26:28-05:00
In wscript, improved clean/distclean logic.

- - - - -


2 changed files:

- pylib/packet.py
- wscript


Changes:

=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -1378,15 +1378,16 @@ class ControlSession:
                                     max(limit + 1,
                                         limit * 33 / 32))
 
-                # prepare next query with as many address and last-seen
-                # timestamps as will fit in a single packet.
+                # Prepare next query with as many address and last-seen
+                # timestamps as will fit in a single packet.  A new nonce
+                # might be required.
+                if time.time() - self.nonce_xmit >= ntp.control.NONCE_TIMEOUT:
+                    nonce = self.fetch_nonce()
                 req_buf = "%s, %s=%d%s" % \
                           (nonce,
                            "frags" if cap_frags else "limit",
                            frags if cap_frags else limit,
                            parms)
-                if time.time() - self.nonce_xmit >= ntp.control.NONCE_TIMEOUT:
-                    nonce = self.fetch_nonce()
                 for i in range(len(span.entries)):
                     e = span.entries[len(span.entries) - i - 1]
                     incr = ", addr.%d=%s, last.%d=%s" % (i, e.addr, i, e.last)


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -114,8 +114,8 @@ def afterparty(ctx):
     # can import compiled Python modules from the build directory.
     # Also, they need to be able to see the Python extension
     # module built in libntp.
-    if ctx.cmd == 'clean':
-        ctx.exec_command("rm -f wafhelpers/*.pyc pylib/__pycache__/*.pyc wafhelpers/__pycache__/*.pyc ntpd/version.h")
+    if ctx.cmd == 'clean' or ctx.cmd == 'distclean':
+        ctx.exec_command("rm -f wafhelpers/*.pyc pylib/__pycache__/*.pyc wafhelpers/__pycache__/*.pyc ntpd/version.h pylib/magic.py pylib/control.py")
     for x in ("ntpclients",):	# List used to be longer...
             path_build = ctx.bldnode.make_node("pylib")
             path_source = ctx.srcnode.make_node(x + "/ntp")
@@ -194,7 +194,7 @@ def build(ctx):
         )
 
         ctx.add_post_fun(afterparty)
-        if ctx.cmd == 'clean':
+        if ctx.cmd == 'clean' or ctx.cmd == 'distclean':
             afterparty(ctx)
 
         ctx.manpage(8, "ntpclients/ntpleapfetch-man.txt")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/4a52effe75f9b618434267a3019178036dca377d...8ae3679769d6df8c2095eda4676b01549116837b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161220/812c9408/attachment.html>


More information about the vc mailing list