[Git][NTPsec/ntpsec][master] ntpd: peer mode unfixable, make 'peer' an alias of 'server' in ntp.conf

Gary E. Miller gitlab at mg.gitlab.com
Wed Oct 26 21:34:16 UTC 2016


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
16686e94 by Gary E. Miller at 2016-10-26T14:31:44-07:00
ntpd: peer mode unfixable, make 'peer' an alias of 'server' in ntp.conf

This solves the problem is you have 'peer's in your ntp.conf.  They are
now treated simply as 'server's.

This does NOT solve the problem of what to do when a real peer packet
is received.  ntpd still drops it.

- - - - -


1 changed file:

- ntpd/ntp_config.c


Changes:

=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -649,40 +649,34 @@ create_peer_node(
 		switch (option->attr) {
 
 		case T_Flag:
-		    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 {
-				switch (option->value.i) {
-
-				default:
-					INSIST(0);
-					break;
+			switch (option->value.i) {
+			default:
+				INSIST(0);
+				break;
 
-				case T_Burst:
-					my_node->ctl.flags |= FLAG_BURST;
-					break;
+			case T_Burst:
+				my_node->ctl.flags |= FLAG_BURST;
+				break;
 
-				case T_Iburst:
-					my_node->ctl.flags |= FLAG_IBURST;
-					break;
+			case T_Iburst:
+				my_node->ctl.flags |= FLAG_IBURST;
+				break;
 
-				case T_Noselect:
-					my_node->ctl.flags |= FLAG_NOSELECT;
-					break;
+			case T_Noselect:
+				my_node->ctl.flags |= FLAG_NOSELECT;
+				break;
 
-				case T_Preempt:
-					my_node->ctl.flags |= FLAG_PREEMPT;
-					break;
+			case T_Preempt:
+				my_node->ctl.flags |= FLAG_PREEMPT;
+				break;
 
-				case T_Prefer:
-					my_node->ctl.flags |= FLAG_PREFER;
-					break;
+			case T_Prefer:
+				my_node->ctl.flags |= FLAG_PREFER;
+				break;
 
-				case T_True:
-					my_node->ctl.flags |= FLAG_TRUE;
-					break;
-				}
+			case T_True:
+				my_node->ctl.flags |= FLAG_TRUE;
+				break;
 			}
 			break;
 
@@ -2813,10 +2807,8 @@ get_correct_host_mode(
 	case T_Server:
 	case T_Pool:
 	case T_Manycastclient:
-		return MODE_CLIENT;
-
 	case T_Peer:
-		return MODE_ACTIVE;
+		return MODE_CLIENT;
 
 	case T_Broadcast:
 		return MODE_BROADCAST;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/16686e9467e6e77bc0b92cbdb5e41bda6576d572
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161026/9e70cfaa/attachment.html>


More information about the vc mailing list