[Git][NTPsec/ntpsec][master] Again, push a test for magic addresses up the call stack.

Eric S. Raymond gitlab at mg.gitlab.com
Fri Jun 24 04:26:15 UTC 2016


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


Commits:
2cba9239 by Eric S. Raymond at 2016-06-24T00:25:35-04:00
Again, push a test for magic addresses up the call stack.

- - - - -


4 changed files:

- include/ntpd.h
- ntpd/ntp_config.c
- ntpd/ntp_peer.c
- ntpd/ntpsim.c


Changes:

=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -180,7 +180,7 @@ extern	void	peer_clr_stats	(void);
 extern	struct peer *peer_config(sockaddr_u *, const char *,
 				 endpt *, uint8_t, uint8_t,
 				 uint8_t, uint8_t, u_int, uint32_t,
-				 keyid_t);
+				 keyid_t, bool);
 extern	void	peer_reset	(struct peer *);
 extern	void	refresh_all_peerinterfaces(void);
 extern	void	unpeer		(struct peer *);


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -3072,7 +3072,8 @@ config_peers(
 					0,
 					FLAG_IBURST,
 					0,
-					0);
+					0,
+					false);
 		} else if (force_synchronous_dns) {
 			if (intercept_getaddrinfo(*cmdline_servers, &peeraddr)) {
 				peer_config(
@@ -3085,7 +3086,8 @@ config_peers(
 					0,
 					FLAG_IBURST,
 					0,
-					0);
+					0,
+					false);
 			}
 		} else {
 			/* we have a hostname to resolve */
@@ -3135,7 +3137,8 @@ config_peers(
 				curr_peer->maxpoll,
 				peerflag_bits(curr_peer),
 				curr_peer->ttl,
-				curr_peer->peerkey);
+				curr_peer->peerkey,
+				ISREFCLOCKADR(&peeraddr));
 		/*
 		 * If we have a numeric address, we can safely
 		 * proceed in the mainline with it.
@@ -3156,7 +3159,8 @@ config_peers(
 					curr_peer->maxpoll,
 					peerflag_bits(curr_peer),
 					curr_peer->ttl,
-					curr_peer->peerkey);
+					curr_peer->peerkey,
+					false);
 		/*
 		 * synchronous lookup may be forced.
 		 */
@@ -3172,7 +3176,8 @@ config_peers(
 					curr_peer->maxpoll,
 					peerflag_bits(curr_peer),
 					curr_peer->ttl,
-					curr_peer->peerkey);
+					curr_peer->peerkey,
+					false);
 			}
 		} else {
 			/* hand the hostname off to the blocking child */
@@ -3277,7 +3282,8 @@ peer_name_resolved(
 				ctx->maxpoll,
 				ctx->flags,
 				ctx->ttl,
-				ctx->keyid);
+				ctx->keyid,
+				false);
 			break;
 		}
 	}


=====================================
ntpd/ntp_peer.c
=====================================
--- a/ntpd/ntp_peer.c
+++ b/ntpd/ntp_peer.c
@@ -557,7 +557,8 @@ peer_config(
 	uint8_t		maxpoll,
 	u_int		flags,
 	uint32_t		ttl,
-	keyid_t		key
+	keyid_t		key,
+	bool		refclock
 	)
 {
 	uint8_t cast_flags;
@@ -602,7 +603,7 @@ peer_config(
 		flags &= ~FLAG_PREEMPT;
 	return newpeer(srcadr, hostname, dstadr, hmode, version,
 		       minpoll, maxpoll, flags, cast_flags, ttl, key,
-		       ISREFCLOCKADR(srcadr));
+		       refclock);
 }
 
 /*


=====================================
ntpd/ntpsim.c
=====================================
--- a/ntpd/ntpsim.c
+++ b/ntpd/ntpsim.c
@@ -86,7 +86,8 @@ void create_server_associations(void)
 				NTP_MAXDPOLL,
 				0, /* peerflags */
 				0, /* ttl */
-				0, /* peerkey */) == 0) {
+				0, /* peerkey */
+				false) == 0) {
 			fprintf(stderr,
 				"ERROR!! Could not create association for: %s\n",
 				stoa(simulation.servers[i].addr));



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/2cba92396697758bd9aca35d302ecf0c9b95c6fd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160624/cca2daea/attachment.html>


More information about the vc mailing list