[Git][NTPsec/ntpsec][master] Fix signed vs unisgned issue in shipping NTS cookie counts.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Feb 21 06:26:42 UTC 2019


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


Commits:
54dd82ca by Eric S. Raymond at 2019-02-21T06:26:29Z
Fix signed vs unisgned issue in shipping NTS cookie counts.

- - - - -


2 changed files:

- ntpd/ntp_control.c
- pylib/util.py


Changes:

=====================================
ntpd/ntp_control.c
=====================================
@@ -2254,7 +2254,7 @@ ctl_putpeer(
 		break;
 
 	case CP_NTSCOOKIES:
-		ctl_putuint(peer_var[id].text, p->nts_state.count);
+		ctl_putint(peer_var[id].text, p->nts_state.count);
 		break;
 
 	default:


=====================================
pylib/util.py
=====================================
@@ -1109,10 +1109,9 @@ class PeerSummary:
                 ptype = 'p'     # pool
             elif srcadr.startswith("224."):
                 ptype = 'a'     # manycastclient (compatibility with Classic)
-            # FIXME: We're getting garbage value for the cookie count
-            #elif ntscookies != 0:
-            #    # FIXME: Will foo up if there are ever more than 9 cookies
-            #    ptype = chr(ntscookies + ord('0'))
+            elif ntscookies > 0:
+                # FIXME: Will foo up if there are ever more than 9 cookies
+                ptype = chr(ntscookies + ord('0'))
             else:
                 ptype = 'u'     # unicast
         elif hmode == ntp.magic.MODE_ACTIVE:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/54dd82ca13180b701f3d2fc78cbb26b17efdef29

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/54dd82ca13180b701f3d2fc78cbb26b17efdef29
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/20190221/9d5c4147/attachment.html>


More information about the vc mailing list