<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>
Eric S. Raymond pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/f5761efdf50fdc84720b0e848e67830be7c0a13e">f5761efd</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-30T12:27:31Z</i>
</div>
<pre class='commit-message'>Dead-code removal and typo fix.</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/6d4c48dda9f9071aba63bc11f300e9e92d8fdceb">6d4c48dd</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-30T23:14:24Z</i>
</div>
<pre class='commit-message'>Replay - force synchronous DNS lookup in capture and replay mode.</pre>
</li>
</ul>
<h4>3 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
include/ntp_config.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_config.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
ntpd/ntp_intercept.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/73f0adacf1a7412a382fe936c59ac0155015a94b...6d4c48dda9f9071aba63bc11f300e9e92d8fdceb#diff-0'>
<strong>
include/ntp_config.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/ntp_config.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/ntp_config.h
</span><span style="color: #aaaaaa">@@ -43,6 +43,7 @@
</span> /* list of servers from command line for config_peers() */
extern int cmdline_server_count;
extern char ** cmdline_servers;
<span style="color: #000000;background-color: #ddffdd">+extern bool force_synchronous_dns;
</span>
/* set to false if admin doesn't want memory locked */
extern bool do_memlock;
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/73f0adacf1a7412a382fe936c59ac0155015a94b...6d4c48dda9f9071aba63bc11f300e9e92d8fdceb#diff-1'>
<strong>
ntpd/ntp_config.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_config.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_config.c
</span><span style="color: #aaaaaa">@@ -53,6 +53,7 @@
</span> /* list of servers from command line for config_peers() */
int cmdline_server_count;
char ** cmdline_servers;
<span style="color: #000000;background-color: #ddffdd">+bool force_synchronous_dns;
</span>
/* set to false if admin doesn't want memory locked */
bool do_memlock = true;
<span style="color: #aaaaaa">@@ -3687,7 +3688,6 @@ peerflag_bits(
</span> return peerflags;
}
<span style="color: #000000;background-color: #ffdddd">-
</span> static void
config_peers(
config_tree *ptree
<span style="color: #aaaaaa">@@ -3728,6 +3728,53 @@ config_peers(
</span> 0,
0,
NULL);
<span style="color: #000000;background-color: #ddffdd">+ } else if (force_synchronous_dns) {
+ sockaddr_u peeraddr;
+ struct addrinfo hints;
+
+ struct addrinfo *res;
+ int a_info;
+ size_t octets;
+
+ ZERO(hints);
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+ a_info = getaddrinfo(*cmdline_servers,
+ "ntp", &hints,
+ &res);
+ if (a_info == EAI_NONAME
+#ifdef EAI_NODATA
+ || a_info == EAI_NODATA
+#endif
+ ) {
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_flags |= AI_ADDRCONFIG;
+ a_info = getaddrinfo(*cmdline_servers, "ntp", &hints, &res);
+ }
+ if (a_info != 0) {
+ msyslog(LOG_ERR,
+ "hostname %s can not be used (%s), please use IP address.",
+ *cmdline_servers, gai_strerror(a_info));
+ } else {
+ INSIST(res != NULL);
+ ZERO(peeraddr);
+ octets = min(sizeof(peeraddr), res->ai_addrlen);
+ memcpy(&peeraddr, res->ai_addr, octets);
+
+ peer_config(
+ &peeraddr,
+ NULL,
+ NULL,
+ MODE_CLIENT,
+ NTP_VERSION,
+ 0,
+ 0,
+ FLAG_IBURST,
+ 0,
+ 0,
+ NULL);
+ }
</span> } else {
/* we have a hostname to resolve */
# ifdef USE_WORKER
<span style="color: #aaaaaa">@@ -3750,8 +3797,8 @@ config_peers(
</span> (void *)ctx);
# else /* !USE_WORKER follows */
msyslog(LOG_ERR,
<span style="color: #000000;background-color: #ffdddd">- "hostname %s can not be used, please use IP address instead.",
- curr_peer->addr->address);
</span><span style="color: #000000;background-color: #ddffdd">+ "hostname %s can not be used (%s), please use IP address instead.",
+ curr_peer->addr->address, gai_strerror(a_info));
</span> # endif
}
}
<span style="color: #aaaaaa">@@ -3780,8 +3827,7 @@ config_peers(
</span> curr_peer->group);
/*
* If we have a numeric address, we can safely
<span style="color: #000000;background-color: #ffdddd">- * proceed in the mainline with it. Otherwise, hand
- * the hostname off to the blocking child.
</span><span style="color: #000000;background-color: #ddffdd">+ * proceed in the mainline with it.
</span> */
} else if (is_ip_address(curr_peer->addr->address,
curr_peer->addr->type, &peeraddr)) {
<span style="color: #aaaaaa">@@ -3801,8 +3847,58 @@ config_peers(
</span> curr_peer->ttl,
curr_peer->peerkey,
curr_peer->group);
<span style="color: #000000;background-color: #ddffdd">+ /*
+ * synchronous lookup may be forced.
+ */
+ } else if (force_synchronous_dns) {
+ sockaddr_u peeraddr;
+ struct addrinfo hints;
+
+ struct addrinfo *res;
+ int a_info;
+ size_t octets;
+
+ ZERO(hints);
+ hints.ai_family = curr_peer->addr->type;
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = IPPROTO_UDP;
+ a_info = getaddrinfo(curr_peer->addr->address,
+ "ntp", &hints,
+ &res);
+ if (a_info == EAI_NONAME
+#ifdef EAI_NODATA
+ || a_info == EAI_NODATA
+#endif
+ ) {
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_flags |= AI_ADDRCONFIG;
+ a_info = getaddrinfo(curr_peer->addr->address, "ntp", &hints, &res);
+ }
+ if (a_info != 0) {
+ msyslog(LOG_ERR,
+ "hostname %s can not be used, please use IP address.",
+ curr_peer->addr->address);
+ } else {
+ INSIST(res != NULL);
+ ZERO(peeraddr);
+ octets = min(sizeof(peeraddr), res->ai_addrlen);
+ memcpy(&peeraddr, res->ai_addr, octets);
+
+ peer_config(
+ &peeraddr,
+ NULL,
+ NULL,
+ hmode,
+ curr_peer->peerversion,
+ curr_peer->minpoll,
+ curr_peer->maxpoll,
+ peerflag_bits(curr_peer),
+ curr_peer->ttl,
+ curr_peer->peerkey,
+ curr_peer->group);
+ }
</span> } else {
<span style="color: #000000;background-color: #ffdddd">- /* we have a hostname to resolve */
</span><span style="color: #000000;background-color: #ddffdd">+ /* hand the hostname off to the blocking child */
</span> # ifdef USE_WORKER
ctx = emalloc_zero(sizeof(*ctx));
ctx->family = curr_peer->addr->type;
</code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/73f0adacf1a7412a382fe936c59ac0155015a94b...6d4c48dda9f9071aba63bc11f300e9e92d8fdceb#diff-2'>
<strong>
ntpd/ntp_intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_intercept.c
</span><span style="color: #aaaaaa">@@ -123,6 +123,7 @@ void intercept_set_mode(intercept_mode newmode)
</span> if (mode != none) {
syslogit = false;
hashprefix = true;
<span style="color: #000000;background-color: #ddffdd">+ force_synchronous_dns = true;
</span> }
}
<span style="color: #aaaaaa">@@ -381,7 +382,7 @@ void intercept_drift_write(char *driftfile, double drift)
</span> */
float df;
get_operation("drift-write ");
<span style="color: #000000;background-color: #ffdddd">- /* See the comment of drift-read chwxcking. */
</span><span style="color: #000000;background-color: #ddffdd">+ /* See the comment of drift-read checking. */
</span> if (sscanf(linebuf, "drift-write %f'", &df) != 1) {
fprintf(stderr, "ntpd: garbled drift-write format, line %d\n",lineno);
exit(1);
<span style="color: #aaaaaa">@@ -614,13 +615,6 @@ intercept_leapsec_load_file(
</span> return loaded;
}
<span style="color: #000000;background-color: #ffdddd">-#define LFPTOUINT64(lfp) ((lfp)->l_uf | ((lfp)->l_ui << ))
-
-/*
- * These functions are requited beaus dplfptoa() is lodssy and won't
- * invert properly thrpugh atolfp().
- */
-
</span> static char *lfpdump(l_fp *fp)
{
char *buf;
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/73f0adacf1a7412a382fe936c59ac0155015a94b...6d4c48dda9f9071aba63bc11f300e9e92d8fdceb">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
</p>
</div>
</body>
</html>