[Git][NTPsec/ntpsec][master] 2 commits: Argh. Repair broken sys_var table

Hal Murray gitlab at mg.gitlab.com
Mon Dec 19 01:04:18 UTC 2016


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
171a2986 by Hal Murray at 2016-12-18T17:01:38-08:00
Argh.  Repair broken sys_var table

I commented out an unused slot rather than replacing it
with a dummy slot.

- - - - -
d690cb89 by Hal Murray at 2016-12-18T17:01:38-08:00
Minor boolification

- - - - -


1 changed file:

- ntpd/ntp_control.c


Changes:

=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -338,7 +338,7 @@ static const struct ctl_var sys_var[] = {
 	{ CS_SS_PROCESSED,	RO, "ss_processed" },	/* 43 */
 	{ CS_PEERADR,		RO, "peeradr" },	/* 44 */
 	{ CS_PEERMODE,		RO, "peermode" },	/* 45 */
-	/*{ CS_BCASTDELAY,	RO, "bcastdelay" },	** 46 */
+	{ 46,			RO, "was bcastdelay" },	/* 46 */
 	{ CS_AUTHDELAY,		RO, "authdelay" },	/* 47 */
 	{ CS_AUTHKEYS,		RO, "authkeys" },	/* 48 */
 	{ CS_AUTHFREEK,		RO, "authfreek" },	/* 49 */
@@ -2641,7 +2641,7 @@ read_peervars(void)
 	if (res_authokay)
 		peer->num_events = 0;
 	ZERO(wants);
-	gotvar = 0;
+	gotvar = false;
 	while (NULL != (v = ctl_getitem(peer_var, &valuep))) {
 		if (v->flags & EOV) {
 			ctl_error(CERR_UNKNOWNVAR);
@@ -2649,7 +2649,7 @@ read_peervars(void)
 		}
 		NTP_INSIST(v->code < COUNTOF(wants));
 		wants[v->code] = 1;
-		gotvar = 1;
+		gotvar = true;
 	}
 	if (gotvar) {
 		for (i = 1; i < COUNTOF(wants); i++)
@@ -2671,7 +2671,7 @@ read_sysvars(void)
 	const struct ctl_var *v;
 	struct ctl_var *kv;
 	u_int	n;
-	u_int	gotvar;
+	bool	gotvar;
 	const uint8_t *cs;
 	char *	valuep;
 	const char * pch;
@@ -2687,12 +2687,12 @@ read_sysvars(void)
 		ctl_sys_num_events = 0;
 	wants_count = CS_MAXCODE + 1 + count_var(ext_sys_var);
 	wants = emalloc_zero(wants_count);
-	gotvar = 0;
+	gotvar = false;
 	while (NULL != (v = ctl_getitem(sys_var, &valuep))) {
 		if (!(EOV & v->flags)) {
 			NTP_INSIST(v->code < wants_count);
 			wants[v->code] = 1;
-			gotvar = 1;
+			gotvar = true;
 		} else {
 			v = ctl_getitem(ext_sys_var, &valuep);
 			if (NULL == v) {
@@ -2709,7 +2709,7 @@ read_sysvars(void)
 			n = v->code + CS_MAXCODE + 1;
 			NTP_INSIST(n < wants_count);
 			wants[n] = 1;
-			gotvar = 1;
+			gotvar = true;
 		}
 	}
 	if (gotvar) {
@@ -3955,7 +3955,7 @@ read_clockstatus(
 	char *			valuep;
 	uint8_t *		wants;
 	size_t			wants_alloc;
-	int			gotvar;
+	bool			gotvar;
 	const uint8_t *		cc;
 	struct ctl_var *	kv;
 	struct refclockstat	cs;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/4ad2e9c83baa966a397d54845ed0cacb7e80dada...d690cb89d92e455d563e50e7fce942d91660d3bb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161219/4c5059de/attachment.html>


More information about the vc mailing list