[Git][NTPsec/ntpsec][master] Replaced decimal with hex number for better semantics.

Ian Bruene gitlab at mg.gitlab.com
Fri Aug 25 22:41:03 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
0e459b37 by Ian Bruene at 2017-08-25T17:39:22-05:00
Replaced decimal with hex number for better semantics.

Also removed forgotten FIXME comment

- - - - -


1 changed file:

- pylib/packet.py


Changes:

=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -912,7 +912,6 @@ class ControlSession:
                     raise ControlException(SERR_NOTRUST)
             try:
                 key_id = int(input("Keyid: "))
-                # FIXME: Magic number, yuck
                 if key_id == 0 or key_id > MAX_KEYID:
                     raise ControlException(SERR_BADKEY)
             except (SyntaxError, ValueError):
@@ -968,7 +967,7 @@ class ControlSession:
         pkt = ControlPacket(self, opcode, associd, qdata)
 
         self.sequence += 1
-        self.sequence %= 65536  # Has to fit in a struct H field
+        self.sequence %= 0x10000  # Has to fit in a struct H field
         pkt.sequence = self.sequence
 
         # If we have data, pad it out to a 32-bit boundary.



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0e459b375b2a83ff6b34041f295b2e26b65611f4

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0e459b375b2a83ff6b34041f295b2e26b65611f4
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170825/d8559458/attachment.html>


More information about the vc mailing list