[Git][NTPsec/ntpsec][master] 2 commits: Booleanization.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Jun 12 20:35:30 UTC 2016


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


Commits:
79218753 by Eric S. Raymond at 2016-06-12T16:09:01-04:00
Booleanization.

- - - - -
46863cec by Eric S. Raymond at 2016-06-12T16:34:31-04:00
Gitlab issue #82: doc says not to use iburst with peers, just prevent it

- - - - -


2 changed files:

- docs/driver8.txt
- ntpd/ntp_config.c


Changes:

=====================================
docs/driver8.txt
=====================================
--- a/docs/driver8.txt
+++ b/docs/driver8.txt
@@ -18,8 +18,8 @@ The PARSE driver supports 25 different clock
 types/configurations. PARSE is actually a multi-clock driver.
 
 Note that some of these modes below are to support equipment that
-has not been commercially available for a long time; and may be
-removed.  See
+has not been commercially available for a long time, and may be
+removed in a future release.  See
 https://www.ntpsec.org/removal-plan.html[Feature removals] for a
 discussion of this issue.
 


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -630,8 +630,8 @@ create_peer_node(
 {
 	peer_node *my_node;
 	attr_val *option;
-	int freenode;
-	int errflag = 0;
+	bool freenode;
+	int errflag = false;
 
 	my_node = emalloc_zero(sizeof(*my_node));
 
@@ -658,13 +658,18 @@ create_peer_node(
 			break;
 		}
 
-		freenode = 1;
+		freenode = true;
 		/* Check the kind of option being set */
 		switch (option->attr) {
 
 		case T_Flag:
-			APPEND_G_FIFO(my_node->peerflags, option);
-			freenode = 0;
+		    if (hmode == T_Peer && option->attr == T_Flag && (option->value.i == T_Iburst || option->value.i == T_Burst)) {
+				msyslog(LOG_INFO,
+					"peer: ignoring burst or iburst option");
+			} else {
+				APPEND_G_FIFO(my_node->peerflags, option);
+				freenode = false;
+			}
 			break;
 
 		case T_Minpoll:
@@ -697,7 +702,7 @@ create_peer_node(
 		case T_Ttl:
 			if (option->value.u >= MAX_TTL) {
 				msyslog(LOG_ERR, "ttl: invalid argument");
-				errflag = 1;
+				errflag = true;
 			} else {
 				my_node->ttl = (uint8_t)option->value.u;
 			}
@@ -710,7 +715,7 @@ create_peer_node(
 		case T_Key:
 			if (option->value.u >= KEYID_T_MAX) {
 				msyslog(LOG_ERR, "key: invalid argument");
-				errflag = 1;
+				errflag = true;
 			} else {
 				my_node->peerkey =
 					(keyid_t)option->value.u;
@@ -720,7 +725,7 @@ create_peer_node(
 		case T_Version:
 			if (option->value.u >= UCHAR_MAX) {
 				msyslog(LOG_ERR, "version: invalid argument");
-				errflag = 1;
+				errflag = true;
 			} else {
 				my_node->peerversion =
 					(uint8_t)option->value.u;
@@ -731,7 +736,7 @@ create_peer_node(
 			msyslog(LOG_ERR,
 				"Unknown peer/server option token %s",
 				token_name(option->attr));
-			errflag = 1;
+			errflag = true;
 		}
 		if (freenode)
 			free(option);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e2b0a0886bf13e55a1b83c64abd86b8b5ce2a915...46863cec400b4159ed984a03e67fa6b29a200f7c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160612/12054ac3/attachment.html>


More information about the vc mailing list