[Git][NTPsec/ntpsec][master] NTP_ constants are defined in ntp.ntp_magic, not ntp.packet

Eric S. Raymond gitlab at mg.gitlab.com
Mon Nov 28 05:07:09 UTC 2016


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


Commits:
f360bdf5 by Matt Selsky at 2016-11-27T19:48:58-05:00
NTP_ constants are defined in ntp.ntp_magic, not ntp.packet

- - - - -


1 changed file:

- ntpq/ntpq


Changes:

=====================================
ntpq/ntpq
=====================================
--- a/ntpq/ntpq
+++ b/ntpq/ntpq
@@ -167,7 +167,7 @@ class Ntpq(cmd.Cmd):
         self.chosts = []		# Command-line hosts
         self.peers = []			# Data from NTP peers.
         self.debug = 0
-        self.pktversion = ntp.packet.NTP_OLDVERSION + 1
+        self.pktversion = ntp.ntp_magic.NTP_OLDVERSION + 1
         self.uservars = collections.OrderedDict()
         self.ai_family = socket.AF_UNSPEC
 
@@ -251,7 +251,7 @@ usage: help [ command ]
                 auth = "ok "
             else:
                 auth = "bad"
-            if self.pktversion > ntp.packet.NTP_OLDVERSION:
+            if self.pktversion > ntp.ntp_magic.NTP_OLDVERSION:
                 seldict = {
                     ntp.ntp_control.CTL_PST_SEL_REJECT: "reject",
                     ntp.ntp_control.CTL_PST_SEL_SANE: "falsetick",
@@ -780,11 +780,11 @@ usage: authenticate [ yes|no ]
         else:
             try:
                 newversion = int(line)
-                if newversion >= ntp.packet.NTP_OLDVERSION and newversion <= ntp.packet.NTP_VERSION:
+                if newversion >= ntp.ntp_magic.NTP_OLDVERSION and newversion <= ntp.ntp_magic.NTP_VERSION:
                     self.pktversion = newversion
                 else:
                     print("versions %d to %d, please"
-                          % (ntp.packet.NTP_OLDVERSION, ntp.packet.NTP_VERSION))
+                          % (ntp.ntp_magic.NTP_OLDVERSION, ntp.ntp_magic.NTP_VERSION))
             except ValueError:
                 print("What?")
         print("NTP version being claimed is %d" % self.pktversion)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f360bdf5df2458f4b0c490341e24f4b48f97033b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161128/0aa49a60/attachment.html>


More information about the vc mailing list