<pre style='margin:0'>
tobypeterson pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/7ee15590ad02cff4773b71f0c86dc32bb9c25e62">https://github.com/macports/macports-ports/commit/7ee15590ad02cff4773b71f0c86dc32bb9c25e62</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 7ee1559 ntpsec: update to 1.1.3
</span>7ee1559 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 7ee15590ad02cff4773b71f0c86dc32bb9c25e62
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Tue Jan 15 16:41:23 2019 -0800
<span style='display:block; white-space:pre;color:#404040;'> ntpsec: update to 1.1.3
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This includes the changes for compatibility with macOS<10.13,
</span><span style='display:block; white-space:pre;color:#404040;'> which can also be seen at:
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> https://gitlab.com/fhgwright/ntpsec/tree/macports_1_1_3
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> TESTED:
</span><span style='display:block; white-space:pre;color:#404040;'> Built and ran on MacPro 10.9, MacPro 10.14, MacBookPro 10.9,
</span><span style='display:block; white-space:pre;color:#404040;'> PowerBook 10.5, and VMs for 10.5-10.13. Built with default
</span><span style='display:block; white-space:pre;color:#404040;'> variants, all single non-default variants, and all non-default
</span><span style='display:block; white-space:pre;color:#404040;'> variants.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> NOTE:
</span><span style='display:block; white-space:pre;color:#404040;'> Does not address ticket 57272 (s/b low priority).
</span>---
sysutils/ntpsec/Portfile | 13 +-
sysutils/ntpsec/files/patch-PreHighSierra.diff | 283 +++++++++++++------------
2 files changed, 160 insertions(+), 136 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/ntpsec/Portfile b/sysutils/ntpsec/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 89524a9..a277b99 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/sysutils/ntpsec/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/ntpsec/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup waf 1.0
</span> PortGroup python 1.0
name ntpsec
<span style='display:block; white-space:pre;background:#ffe0e0;'>-version 1.1.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 1.1.3
</span> categories sysutils net
maintainers {fwright.net:fw @fhgwright} openmaintainer
description A secure, hardened, and improved implementation of NTP
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,9 +18,9 @@ homepage https://www.ntpsec.org/
</span> conflicts ntp openntpd
master_sites ftp://ftp.ntpsec.org/pub/releases/
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums rmd160 b876eca0fca5cd92fd813fa9520f1c110e5df320 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 9dfaf1d791109160b3632a203bd75c784c54902442cea36983d5131b9f3b0111 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 2458805
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 cdaae8f682cd4cc97a37d86aca1d3196cfea0437 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 226b4b29d5166ea3d241a24f7bfc2567f289cf6ed826d8aeb9f2f261c1836bde \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 2462330
</span>
depends_build port:bison
depends_lib path:lib/libssl.dylib:openssl port:python${python.version}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -29,7 +29,10 @@ patchfiles patch-PreHighSierra.diff
</span>
post-destroot {
foreach f {ntpdig ntpkeygen ntploggps ntplogtemp ntpmon ntpq ntpsnmpd ntpsweep ntptrace ntpviz ntpwait} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- reinplace "s,^#!/usr/bin/env python,#!${python.bin}," ${destroot}${prefix}/bin/$f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Some programs may not exist, e.g. ntploggps w/o gpsd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${destroot}${prefix}/bin/$f]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s,^#!/usr/bin/env python,#!${python.bin}," ${destroot}${prefix}/bin/$f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/ntpsec/files/patch-PreHighSierra.diff b/sysutils/ntpsec/files/patch-PreHighSierra.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 5446de8..8dbfb1e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/sysutils/ntpsec/files/patch-PreHighSierra.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/ntpsec/files/patch-PreHighSierra.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,5 +1,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./attic/clocks.c.orig 2019-01-13 21:40:59.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./attic/clocks.c 2019-01-15 12:40:57.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -5,6 +5,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <stdio.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include "ntp_machine.h" /* For clock_gettime fallback */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct table {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const char* name;
</span> --- ./attic/digest-timing.c.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./attic/digest-timing.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./attic/digest-timing.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -34,6 +34,8 @@
#include <openssl/rand.h>
#include <openssl/objects.h>
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,73 +20,9 @@
</span> #define UNUSED_ARG(arg) ((void)(arg))
#ifndef EVP_MD_CTX_reset
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -44,6 +46,23 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define EVP_MD_CTX_reset(ctx) EVP_MD_CTX_init(ctx)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Pecking order for clock_gettime interval measurements
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * CLOCK_MONOTONIC_RAW is free of NTP adjustments
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * CLOCK_MONOTONIC is affected by NTP slewing but not step adjustments
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * CLOCK_REALTIME is affected by all NTP adjustments, including stepping
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Assuming this test isn't run while stepping is a possibility,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * even CLOCK_REALTIME is acceptable.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#if defined(CLOCK_MONOTONIC_RAW)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define CLOCK_INTERVAL CLOCK_MONOTONIC_RAW
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#elif defined(CLOCK_MONOTONIC)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define CLOCK_INTERVAL CLOCK_MONOTONIC
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define CLOCK_INTERVAL CLOCK_REALTIME
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Get timing for old slower way too. Pre Feb 2018 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define DoSLOW 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -146,21 +165,21 @@ static void DoDigest(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (NULL == digest) return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_MONOTONIC, &start);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_gettime(CLOCK_INTERVAL, &start);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for (i = 0; i < NUM; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- digestlength = SSL_Digest(digest, key, keylength, pkt, pktlength);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_MONOTONIC, &stop);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_gettime(CLOCK_INTERVAL, &stop);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fast = (stop.tv_sec-start.tv_sec)*1E9 + (stop.tv_nsec-start.tv_nsec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- printf("%10s %2d %2d %2u %6.0f %6.3f",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name, keylength, pktlength, digestlength, fast/NUM, fast/1E9);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #ifdef DoSLOW
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_MONOTONIC, &start);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_gettime(CLOCK_INTERVAL, &start);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for (i = 0; i < NUM; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- digestlength = SSL_DigestSlow(type, key, keylength, pkt, pktlength);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_MONOTONIC, &stop);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_gettime(CLOCK_INTERVAL, &stop);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- slow = (stop.tv_sec-start.tv_sec)*1E9 + (stop.tv_nsec-start.tv_nsec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- printf(" %6.0f %2.0f %4.0f",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- slow/NUM, (slow-fast)*100.0/slow, (slow-fast)/NUM);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -185,11 +204,11 @@ static void DoCMAC(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (NULL == cipher) return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_MONOTONIC, &start);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_gettime(CLOCK_INTERVAL, &start);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for (i = 0; i < NUM; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- digestlength = SSL_CMAC(cipher, key, keylength, pkt, pktlength);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- clock_gettime(CLOCK_MONOTONIC, &stop);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ clock_gettime(CLOCK_INTERVAL, &stop);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fast = (stop.tv_sec-start.tv_sec)*1E9 + (stop.tv_nsec-start.tv_nsec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- printf("%10s %2d %2d %2lu %6.0f %6.3f",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name, keylength, pktlength, digestlength, fast/NUM, fast/1E9);
</span> --- ./include/ntp_machine.h.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./include/ntp_machine.h 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -13,14 +13,53 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./include/ntp_machine.h 2019-01-15 12:40:57.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -13,14 +13,135 @@
</span>
#ifndef CLOCK_REALTIME
/*
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -84,31 +31,110 @@
</span> + * Handle platforms that don't have a real clock_gettime(2),
+ * notably some versions of Mac OS X.
*/
<span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define CLOCK_REALTIME 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define CLOCK_MONOTONIC 1
</span> +
+#include <errno.h>
+
<span style='display:block; white-space:pre;background:#ffe0e0;'>- #define CLOCK_REALTIME 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#define CLOCK_MONOTONIC 1
</span> typedef int clockid_t;
-int clock_gettime(clockid_t clock_id, struct timespec *tp);
-#endif
+
<span style='display:block; white-space:pre;background:#e0ffe0;'>++#define CLOCK_REALTIME 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define CLOCK_MONOTONIC 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define CLOCK_MONOTONIC_RAW 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <mach/clock.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <mach/mach.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <mach/mach_time.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* __APPLE__ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span> +static inline int clock_gettime(clockid_t clk_id, struct timespec *tp)
+{
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ struct timeval tv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (clk_id) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLOCK_REALTIME:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * On OSX, it's tempting to use clock_get_time() for its apparent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * nanosecond resolution, but it really only has microsecond
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * resolution, and is substantially slower than gettimeofday().
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct timeval tv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (gettimeofday(&tv, NULL))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp->tv_sec = tv.tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp->tv_nsec = tv.tv_usec * 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLOCK_MONOTONIC:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mach_timespec_t mts;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static clock_serv_t sclock = 0;
</span> +
<span style='display:block; white-space:pre;background:#e0ffe0;'>++ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Obtain clock port on first call, then reuse it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * Rely on exit cleanup to free it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!sclock) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mach_port_t mach_host = mach_host_self();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ host_get_clock_service(mach_host,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ SYSTEM_CLOCK, &sclock);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mach_port_deallocate(mach_task_self(), mach_host);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ clock_get_time(sclock, &mts);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp->tv_sec = mts.tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp->tv_nsec = mts.tv_nsec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLOCK_MONOTONIC_RAW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static mach_timebase_info_data_t sTimebaseInfo = {0, 0};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unsigned long long nanos;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Obtain scale factors on first call, then reuse them. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ( sTimebaseInfo.denom == 0 ) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void) mach_timebase_info(&sTimebaseInfo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ nanos = mach_absolute_time()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * sTimebaseInfo.numer / sTimebaseInfo.denom;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp->tv_sec = nanos / 1000000000U;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tp->tv_nsec = nanos - tp->tv_sec * 1000000000U;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* __APPLE__ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ errno = EINVAL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static inline int clock_getres(clockid_t clk_id, struct timespec *res)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span> + switch (clk_id) {
<span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span> + case CLOCK_REALTIME:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /*
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * On OSX, it's tempting to use clock_get_time() for its apparent
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * nanosecond resolution, but it really only has microsecond
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * resolution, and is substantially slower than gettimeofday().
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (gettimeofday(&tv, NULL))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tp->tv_sec = tv.tv_sec;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tp->tv_nsec = tv.tv_usec * 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ res->tv_sec = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ res->tv_nsec = 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLOCK_MONOTONIC:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case CLOCK_MONOTONIC_RAW:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ res->tv_sec = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ res->tv_nsec = 1;
</span> + return 0;
<span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif /* __APPLE__ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span> + default:
+ errno = EINVAL;
+ return -1;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -117,13 +143,17 @@
</span> +
+static inline int clock_settime(clockid_t clk_id, const struct timespec *tp)
+{
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ struct timeval tv;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span> + switch (clk_id) {
<span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span> + case CLOCK_REALTIME:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tv.tv_sec = tp->tv_sec;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ tv.tv_usec = (tp->tv_nsec + 500) / 1000;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return settimeofday(&tv, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct timeval tv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tv.tv_sec = tp->tv_sec;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tv.tv_usec = (tp->tv_nsec + 500) / 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return settimeofday(&tv, NULL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span> + default:
+ errno = EINVAL;
+ return -1;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -134,9 +164,9 @@
</span>
int ntp_set_tod (struct timespec *tvs);
<span style='display:block; white-space:pre;background:#ffe0e0;'>---- ./include/ntp_stdlib.h.orig 2018-08-28 22:18:48.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./include/ntp_stdlib.h 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -98,7 +98,9 @@ extern const char * eventstr (int);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./include/ntp_stdlib.h.orig 2018-09-25 23:08:35.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./include/ntp_stdlib.h 2019-01-15 12:40:57.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -102,7 +102,9 @@ extern const char * eventstr (int);
</span> extern const char * ceventstr (int);
extern const char * res_match_flags(unsigned short);
extern const char * res_access_flags(unsigned short);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -147,7 +177,7 @@
</span> extern sockaddr_u * netof6 (sockaddr_u *);
extern const char * socktoa (const sockaddr_u *);
--- ./include/ntp_syscall.h.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./include/ntp_syscall.h 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./include/ntp_syscall.h 2019-01-15 12:40:57.000000000 -0800
</span> @@ -9,9 +9,11 @@
#ifndef GUARD_NTP_SYSCALL_H
#define GUARD_NTP_SYSCALL_H
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -160,8 +190,8 @@
</span>
/*
* The units of the maxerror and esterror fields vary by platform. If
<span style='display:block; white-space:pre;background:#ffe0e0;'>---- ./libntp/clockwork.c.orig 2018-08-28 22:18:48.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./libntp/clockwork.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./libntp/clockwork.c.orig 2019-01-13 21:40:59.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./libntp/clockwork.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -5,8 +5,10 @@
#include "config.h"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -175,23 +205,8 @@
</span>
#include "ntp.h"
#include "ntp_machine.h"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -77,14 +79,10 @@ ntp_set_tod(
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int saved_errno;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TPRINT(1, ("In ntp_set_tod\n"));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#ifdef HAVE_CLOCK_SETTIME
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- errno = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rc = clock_settime(CLOCK_REALTIME, tvs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- saved_errno = errno;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TPRINT(1, ("ntp_set_tod: clock_settime: %d %m\n", rc));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#error POSIX clock_settime(2) is required
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#endif /* HAVE_CLOCK_SETTIME */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- errno = saved_errno; /* for %m below */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- TPRINT(1, ("ntp_set_tod: Final result: clock_settime: %d %m\n", rc));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> --- ./libntp/statestr.c.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./libntp/statestr.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./libntp/statestr.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -12,7 +12,9 @@
#include "lib_strbuf.h"
#include "ntp_refclock.h"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -292,9 +307,9 @@
</span>
/*
* statustoa - return a descriptive string for a peer status
<span style='display:block; white-space:pre;background:#ffe0e0;'>---- ./ntpd/ntp_control.c.orig 2018-08-28 22:18:48.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./ntpd/ntp_control.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1464,6 +1464,7 @@ ctl_putsys(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ntpd/ntp_control.c.orig 2019-01-13 21:40:59.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ntpd/ntp_control.c 2019-01-15 12:40:57.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1478,6 +1478,7 @@ ctl_putsys(
</span> char str[256];
double dtemp;
const char *ss;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -302,7 +317,7 @@
</span> static struct timex ntx;
static unsigned long ntp_adjtime_time;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1478,6 +1479,7 @@ ctl_putsys(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1492,6 +1493,7 @@ ctl_putsys(
</span> else
ntp_adjtime_time = current_time;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -310,7 +325,7 @@
</span>
switch (varid) {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1866,50 +1868,93 @@ ctl_putsys(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1880,50 +1882,93 @@ ctl_putsys(
</span> break;
/*
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -417,7 +432,7 @@
</span>
case CS_K_PPS_FREQ:
--- ./ntpd/ntp_loopfilter.c.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./ntpd/ntp_loopfilter.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ntpd/ntp_loopfilter.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -23,8 +23,10 @@
#define NTP_MAXFREQ 500e-6
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -674,7 +689,7 @@
</span> -#endif /* SIGSYS */
+#endif /* HAVE_KERNEL_PLL && SIGSYS */
--- ./ntpd/ntp_timer.c.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./ntpd/ntp_timer.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ntpd/ntp_timer.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -13,7 +13,9 @@
#include <signal.h>
#include <unistd.h>
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -698,7 +713,7 @@
</span> leap_smear.enabled = (leap_smear_intv != 0);
#endif
--- ./ntpd/refclock_local.c.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./ntpd/refclock_local.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ntpd/refclock_local.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -131,6 +131,9 @@ local_poll(
struct peer *peer
)
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -733,8 +748,8 @@
</span> pp->lastref = pp->lastrec;
refclock_receive(peer);
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>---- ./ntpfrob/precision.c.orig 2018-08-28 22:18:48.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./ntpfrob/precision.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./ntpfrob/precision.c.orig 2019-01-13 21:40:59.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./ntpfrob/precision.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -11,6 +11,7 @@
#include "ntp_types.h"
#include "ntp_calendar.h"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -744,7 +759,7 @@
</span> #define DEFAULT_SYS_PRECISION -99
--- ./tests/libntp/statestr.c.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./tests/libntp/statestr.c 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./tests/libntp/statestr.c 2019-01-15 12:40:57.000000000 -0800
</span> @@ -4,7 +4,9 @@
#include "unity.h"
#include "unity_fixture.h"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -765,8 +780,23 @@
</span> }
// statustoa
<span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./wafhelpers/bin_test.py.orig 2019-01-13 21:40:59.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./wafhelpers/bin_test.py 2019-01-15 12:40:57.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -88,6 +88,12 @@ def cmd_bin_test(ctx, config):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for cmd in cmd_map3:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cmd_map2[cmd] = cmd_map3[cmd]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # Kludge to remove ntptime if it didn't get built
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if not ctx.env.HEADER_SYS_TIMEX_H:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for cmd in list(cmd_map.keys()):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if 'ntptime' in cmd[0]:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ del cmd_map[cmd]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for cmd in sorted(cmd_map):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if not run(cmd, cmd_map[cmd], False):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fails += 1
</span> --- ./wafhelpers/options.py.orig 2018-08-28 22:18:48.000000000 -0700
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./wafhelpers/options.py 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./wafhelpers/options.py 2019-01-15 12:40:57.000000000 -0800
</span> @@ -21,6 +21,8 @@ def options_cmd(ctx, config):
default=False, help="Enable seccomp (restricts syscalls).")
grp.add_option('--disable-dns-lookup', action='store_true',
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -776,9 +806,9 @@
</span> grp.add_option('--disable-mdns-registration', action='store_true',
default=False, help="Disable MDNS registration.")
grp.add_option(
<span style='display:block; white-space:pre;background:#ffe0e0;'>---- ./wscript.orig 2018-08-28 22:18:48.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ ./wscript 2018-08-29 15:03:46.000000000 -0700
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -562,13 +562,13 @@ int main(int argc, char **argv) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- ./wscript.orig 2019-01-13 21:40:59.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ ./wscript 2019-01-15 12:40:57.000000000 -0800
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -559,13 +559,13 @@ int main(int argc, char **argv) {
</span> ctx.define("__EXTENSIONS__", "1", quote=False)
structures = (
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -798,16 +828,7 @@
</span>
# waf's SNIP_FIELD should likely include this header itself
# This is needed on some systems to get size_t for following checks
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -626,8 +626,6 @@ int main(int argc, char **argv) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ('adjtimex', ["sys/time.h", "sys/timex.h"]),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ('backtrace_symbols_fd', ["execinfo.h"]),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ('closefrom', ["stdlib.h"]),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- ('clock_gettime', ["time.h"], "RT"),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- ('clock_settime', ["time.h"], "RT"),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ('ntp_adjtime', ["sys/time.h", "sys/timex.h"]), # BSD
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ('ntp_gettime', ["sys/time.h", "sys/timex.h"]), # BSD
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ('res_init', ["netinet/in.h", "arpa/nameser.h", "resolv.h"]),
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -772,6 +770,21 @@ int main(int argc, char **argv) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -765,6 +765,21 @@ int main(int argc, char **argv) {
</span> ctx.define("HAVE_WORKING_FORK", 1,
comment="Whether a working fork() exists")
</pre><pre style='margin:0'>
</pre>