[Git][NTPsec/ntpsec][master] 4 commits: Fix typo in comment
Hal Murray (@hal.murray)
gitlab at mg.gitlab.com
Fri Jun 28 06:40:27 UTC 2024
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
b29a95d6 by Hal Murray at 2024-06-24T02:07:07-07:00
Fix typo in comment
- - - - -
96246604 by Hal Murray at 2024-06-24T20:16:15-07:00
Fix attempt at fixing NetBSD siginfo_t bug
Sigh. Usually I test the actual code that I'm going to push.
Somehow, I botched hat this time.
- - - - -
a48f5bcb by Hal Murray at 2024-06-25T17:44:59-07:00
Drop clock fuzzing.
It's not needed with modern CPUs.
- - - - -
99f1e094 by Hal Murray at 2024-06-26T01:50:55-07:00
Drop old/unused rtems-trace option
- - - - -
20 changed files:
- NEWS.adoc
- include/ntp_fp.h
- include/ntp_stdlib.h
- include/ntpd.h
- libntp/syssignal.c
- libntp/systime.c
- libparse/clk_sel240x.c
- ntpd/ntp_config.c
- ntpd/ntp_control.c
- ntpd/ntp_loopfilter.c
- ntpd/ntp_packetstamp.c
- ntpd/ntp_parser.y
- ntpd/ntp_proto.c
- ntpd/wscript
- pylib/util.py
- tests/option-tester.sh
- tests/pylib/test_util.py
- wafhelpers/options.py
- − wafhelpers/rtems_trace.py
- wscript
Changes:
=====================================
NEWS.adoc
=====================================
@@ -12,6 +12,8 @@ on user-visible changes.
## Repository Head
+* Clock fuzzing is gone. --disable-fuzz is now standard.
+
* ntpd can now listen on a second port. Add either "nts port xxxx"
or "extra port xxxx" in your config file. If either is specified,
the NTS-KE server will tell the client to use that port. This might
=====================================
include/ntp_fp.h
=====================================
@@ -155,9 +155,6 @@ extern char * prettydate (const l_fp);
extern char * rfc3339date (const l_fp);
extern char * rfc3339time (time_t);
-#ifdef ENABLE_FUZZ
-extern void set_sys_fuzz (double);
-#endif
extern void get_systime (l_fp *);
extern bool step_systime (doubletime_t);
extern bool adj_systime (double, int (*adjtime)(const struct timeval *, struct timeval *));
=====================================
include/ntp_stdlib.h
=====================================
@@ -115,7 +115,7 @@ extern const char *refid_str (uint32_t, int);
extern int decodenetnum (const char *, sockaddr_u *);
extern void signal_no_reset (int, void (*func)(int));
-#ifndef __NetBSD
+#ifndef __NetBSD__
extern void signal_no_reset1(int, void (*func)(int, siginfo_t *, void *));
#endif
@@ -160,13 +160,6 @@ extern size_t strlcat(char *dst, const char *src, size_t siz);
/* ntp_proto.c */
extern double measured_tick; /* non-overridable sys_tick */
-#ifdef ENABLE_FUZZ
-/* systime.c */
-extern double sys_tick; /* tick size or time to read */
-extern double sys_fuzz; /* min clock read latency */
-extern bool trunc_os_clock; /* sys_tick > measured_tick */
-#endif
-
/* use these as return values for sort-comparison functions */
#define COMPARE_GREATERTHAN 1
#define COMPARE_EQUAL 0
=====================================
include/ntpd.h
=====================================
@@ -208,9 +208,6 @@ extern void poll_update (struct peer *, uint8_t);
extern void clock_filter (struct peer *, double, double, double);
extern void init_proto (const bool);
-#ifdef ENABLE_FUZZ
-extern void set_sys_tick_precision(double);
-#endif
extern void proto_config (int, unsigned long, double);
extern void proto_clr_stats (void);
=====================================
libntp/syssignal.c
=====================================
@@ -28,7 +28,7 @@ signal_no_reset(
}
}
-#ifndef __NetBSD
+#ifndef __NetBSD__
/* NetBSD 10.0, May 2024, barfs when it can't find siginfo_t ???
* There is a similar test in include/ntp_stdlib.h
* This is only used by ntp_sandbox inside an ifdef for HAVE_SECCOMP_H */
=====================================
libntp/systime.c
=====================================
@@ -56,40 +56,12 @@
* adj_systime() and step_systime() will behave sanely with these
* variables not set, but the adjustments may be in larger steps.
*/
-#ifdef ENABLE_FUZZ
-double sys_tick = 0; /* tick size or time to read (s) */
-double sys_fuzz = 0; /* min. time to read the clock (s) */
-bool trunc_os_clock; /* sys_tick > measured_tick */
-#endif
time_stepped_callback step_callback;
static doubletime_t sys_residual = 0; /* adjustment residue (s) */
-#ifdef ENABLE_FUZZ
-static long sys_fuzz_nsec = 0; /* minimum time to read clock (ns) */
-
-/* perlinger at ntp.org: As 'get_systime()' does its own check for clock
- * backstepping, this could probably become a local variable in
- * 'get_systime()' and the cruft associated with communicating via a
- * static value could be removed after the v4.2.8 release.
- */
-static bool lamport_violated; /* clock was stepped back */
-#endif
static void get_ostime (struct timespec *tsp);
-#ifdef ENABLE_FUZZ
-void
-set_sys_fuzz(
- double fuzz_val
- )
-{
- sys_fuzz = fuzz_val;
- //INSIST(sys_fuzz >= 0);
- //INSIST(sys_fuzz <= 1.0);
- sys_fuzz_nsec = (long)(sys_fuzz * NS_PER_S + 0.5);
-}
-#endif
-
static void
get_ostime(
@@ -107,115 +79,9 @@ get_ostime(
exit(1);
}
-#ifdef ENABLE_FUZZ
- if (trunc_os_clock) {
- long ticks;
- ticks = (long)((tsp->tv_nsec * S_PER_NS) / sys_tick);
- tsp->tv_nsec = (long)(ticks * NS_PER_S * sys_tick);
- }
-#endif
}
-#ifdef ENABLE_FUZZ
-static void normalize_time (struct timespec, long, l_fp *);
-
-static void
-normalize_time(
- struct timespec ts, /* seconds and nanoseconds */
- long randd,
- l_fp *now /* system time */
- )
-{
- static struct timespec ts_last; /* last sampled os time */
- static struct timespec ts_prev; /* prior os time */
- static l_fp lfp_prev; /* prior result */
- static double dfuzz_prev; /* prior fuzz */
- struct timespec ts_min; /* earliest permissible */
- struct timespec ts_lam; /* lamport fictional increment */
- struct timespec ts_prev_log; /* for msyslog only */
- double dfuzz;
- double ddelta;
- l_fp result;
- l_fp lfpfuzz;
- l_fp lfpdelta;
-
- /* First check if there was a Lamport violation, that is, two
- * successive calls to 'get_ostime()' resulted in negative
- * time difference. Use a few milliseconds of permissible
- * tolerance -- being too sharp can hurt here. (This is intended
- * for the Win32 target, where the HPC interpolation might
- * introduce small steps backward. It should not be an issue on
- * systems where get_ostime() results in a true syscall.)
- */
- if (cmp_tspec(add_tspec_ns(ts, 50000000), ts_last) < 0)
- lamport_violated = true;
- ts_last = ts;
-
- /*
- * After default_get_precision() has set a nonzero sys_fuzz,
- * ensure every reading of the OS clock advances by at least
- * sys_fuzz over the prior reading, thereby assuring each
- * fuzzed result is strictly later than the prior. Limit the
- * necessary fiction to 1 second.
- */
- ts_min = add_tspec_ns(ts_prev, sys_fuzz_nsec);
- if (cmp_tspec(ts, ts_min) < 0) {
- ts_lam = sub_tspec(ts_min, ts);
- if (ts_lam.tv_sec > 0 && !lamport_violated) {
- msyslog(LOG_ERR,
- "CLOCK: get_systime Lamport advance exceeds one second (%.9f)",
- ts_lam.tv_sec + S_PER_NS * ts_lam.tv_nsec);
- exit(1);
- }
- if (!lamport_violated)
- ts = ts_min;
- }
- ts_prev_log = ts_prev;
- ts_prev = ts;
-
- /* convert from timespec to l_fp fixed-point */
- result = tspec_stamp_to_lfp(ts);
-
- /*
- * Add in the fuzz.
- */
- dfuzz = randd * 2. / FRAC * sys_fuzz;
- lfpfuzz = dtolfp(dfuzz);
- result += lfpfuzz;
-
- /*
- * Ensure result is strictly greater than prior result (ignoring
- * sys_residual's effect for now) once sys_fuzz has been
- * determined.
- */
- if (lfp_prev != 0 && !lamport_violated) {
- if (!L_ISGTU(result, lfp_prev) &&
- sys_fuzz > 0.) {
- msyslog(LOG_ERR, "CLOCK: ts_prev %ld s + %ld ns, ts_min %ld s + %ld ns",
- (long)ts_prev_log.tv_sec, ts_prev.tv_nsec,
- (long)ts_min.tv_sec, ts_min.tv_nsec);
- msyslog(LOG_ERR, "CLOCK: ts %ld s + %ld ns",
- (long)ts.tv_sec, ts.tv_nsec);
- msyslog(LOG_ERR, "CLOCK: sys_fuzz %ld nsec, prior fuzz %.9f",
- sys_fuzz_nsec, dfuzz_prev);
- msyslog(LOG_ERR, "CLOCK: this fuzz %.9f", dfuzz);
- lfpdelta = lfp_prev;
- lfpdelta -= result;
- ddelta = lfptod(lfpdelta);
- msyslog(LOG_ERR,
- "CLOCK: prev get_systime 0x%x.%08x is %.9f later than 0x%x.%08x",
- lfpuint(lfp_prev), lfpfrac(lfp_prev),
- ddelta, lfpuint(result), lfpfrac(result));
- }
- }
- lfp_prev = result;
- dfuzz_prev = dfuzz;
- lamport_violated = false;
- *now = result;
-}
-#endif
-
/*
* get_systime - return system time in NTP timestamp format.
*/
@@ -226,12 +92,7 @@ get_systime(
{
struct timespec ts; /* seconds and nanoseconds */
get_ostime(&ts);
-#ifdef ENABLE_FUZZ
-/* normalize_time(ts, sys_fuzz > 0.0 ? ntp_random() : 0, now); */
- normalize_time(ts, sys_fuzz > 0.0 ? random() : 0, now);
-#else
*now = tspec_stamp_to_lfp(ts);
-#endif
}
@@ -279,15 +140,7 @@ adj_systime(
}
adjtv.tv_sec = (long)dtemp;
dtemp -= adjtv.tv_sec;
-#ifdef ENABLE_FUZZ
- if (sys_tick > sys_fuzz) {
- quant = sys_tick;
- } else {
- quant = S_PER_US;
- }
-#else
- quant = S_PER_US;
-#endif
+ quant = S_PER_US;
ticks = (long)(dtemp / quant + .5);
adjtv.tv_usec = (long)(ticks * quant * US_PER_S + .5);
/* The rounding in the conversions could push us over the
@@ -433,9 +286,6 @@ step_systime(
}
sys_residual = 0;
-#ifdef ENABLE_FUZZ
- lamport_violated = (step < 0);
-#endif
if (step_callback)
(*step_callback)();
return true;
=====================================
libparse/clk_sel240x.c
=====================================
@@ -4,7 +4,7 @@
#include "config.h"
-// _XOPEN_SORUCE needed for strptime()
+// _XOPEN_SOURCE needed for strptime()
#define _XOPEN_SOURCE
#include "ntp.h" // only for the u_* typedefs from GCC; remove someday
=====================================
ntpd/ntp_config.c
=====================================
@@ -1935,15 +1935,6 @@ config_tinker(
case T_Stepout:
item = LOOP_MINSTEP;
break;
-
- case T_Tick:
-#ifdef ENABLE_FUZZ
- item = LOOP_TICK;
- break;
-#else
- msyslog(LOG_ERR, "ERR: tinker tick not supported");
- continue;
-#endif
}
loop_config(item, tinker->value.d);
}
@@ -2564,12 +2555,6 @@ config_vars(
/* Determine which variable to set and set it */
switch (curr_var->attr) {
-#ifdef ENABLE_FUZZ
- case T_Tick:
- loop_config(LOOP_TICK, curr_var->value.d);
- break;
-#endif
-
case T_Driftfile:
if ('\0' == curr_var->value.s[0]) {
stats_drift_file = 0;
=====================================
ntpd/ntp_control.c
=====================================
@@ -157,10 +157,6 @@ static const struct ctl_proc control_codes[] = {
{ NO_REQUEST, 0, NULL }
};
-#ifndef ENABLE_FUZZ
-static const double dbl_zero = 0.0;
-#endif
-
enum var_type {v_time,
v_str, v_dbl, v_uli, v_li, v_uint, v_int,
v_u64, v_i64, v_u32, v_i32, v_u8, v_i8, v_bool,
@@ -405,14 +401,6 @@ static const struct var sys_var[] = {
Var_uli("timer_overruns", RO, alarm_overflow),
Var_uli("timer_xmts", RO, timer_xmtcalls),
-#ifdef ENABLE_FUZZ
- Var_dbl("fuzz", RO|DBL6|ToMS, sys_fuzz),
- Var_dbl("tick", RO|DBL6|ToMS, sys_tick),
-#else
- Var_dbl("fuzz", RO, dbl_zero),
- Var_dbl("tick", RO, dbl_zero),
-#endif
-
Var_uli("clk_wander_threshold", RO|ToPPM, timer_xmtcalls),
#ifdef ENABLE_LEAP_SMEAR
=====================================
ntpd/ntp_loopfilter.c
=====================================
@@ -1246,12 +1246,6 @@ loop_config(
}
break;
-#ifdef ENABLE_FUZZ
- case LOOP_TICK: /* tick increment (tick) */
- set_sys_tick_precision(freq);
- break;
-#endif
-
case LOOP_LEAP: /* not used, fall through */
default:
msyslog(LOG_NOTICE,
=====================================
ntpd/ntp_packetstamp.c
=====================================
@@ -108,11 +108,6 @@ fetch_packetstamp(
struct timespec * tsp;
#elif defined(SO_TIMESTAMP)
struct timeval * tvp;
-#endif
-#ifdef ENABLE_FUZZ
- unsigned long ticks;
- double fuzz;
- l_fp lfpfuzz;
#endif
l_fp nts = 0; /* network time stamp */
@@ -150,34 +145,16 @@ fetch_packetstamp(
#if defined(SO_TIMESTAMPNS) || defined(SO_TS_CLOCK)
tsp = (struct timespec *)CMSG_DATA(cmsghdr);
-#ifdef ENABLE_FUZZ
- if (sys_tick > measured_tick && sys_tick > S_PER_NS) {
- ticks = (unsigned long) ((tsp->tv_nsec * S_PER_NS) / sys_tick);
- tsp->tv_nsec = (long) (ticks * NS_PER_S * sys_tick);
- }
-#endif
DPRINT(4, ("fetch_timestamp: system nsec network time stamp: %ld.%09ld\n",
(long)tsp->tv_sec, tsp->tv_nsec));
nts = tspec_stamp_to_lfp(*tsp);
#elif defined(SO_TIMESTAMP)
tvp = (struct timeval *)CMSG_DATA(cmsghdr);
-#ifdef ENABLE_FUZZ
- if (sys_tick > measured_tick && sys_tick > S_PER_NS) {
- ticks = (unsigned long) ((tvp->tv_usec * S_PER_NS) / sys_tick);
- tvp->tv_usec = (long)(ticks * US_PER_S * sys_tick);
- }
-#endif
DPRINT(4, ("fetch_timestamp: system usec network time stamp: %jd.%06ld\n",
(intmax_t)tvp->tv_sec, (long)tvp->tv_usec));
nts = tspec_stamp_to_lfp(tval_to_tspec(*tvp));
#else
# error "Can't get packet timestamp"
-#endif
-#ifdef ENABLE_FUZZ
-/* fuzz = ntp_random() * 2. / FRAC * sys_fuzz; */
- fuzz = random() * 2. / FRAC * sys_fuzz;
- lfpfuzz = dtolfp(fuzz);
- nts += lfpfuzz;
#endif
return nts;
}
=====================================
ntpd/ntp_parser.y
=====================================
@@ -1138,7 +1138,6 @@ tinker_option_keyword
| T_Stepback
| T_Stepfwd
| T_Stepout
- | T_Tick
;
=====================================
ntpd/ntp_proto.c
=====================================
@@ -211,19 +211,11 @@ void set_use_stattime(uptime_t stattime) {
}
-#ifdef ENABLE_FUZZ
-double measured_tick; /* non-overridable sys_tick (s) */
-#endif
-
static void clock_combine (peer_select *, int, int);
static void clock_select (void);
static void clock_update (struct peer *);
static void fast_xmit (struct recvbuf *, auth_info*, int);
static int local_refid (struct peer *);
-#ifdef ENABLE_FUZZ
-static void measure_precision(const bool);
-static double measure_tick_fuzz(void);
-#endif
static void peer_xmit (struct peer *);
static int peer_unfit (struct peer *);
static double root_distance (struct peer *);
@@ -2712,152 +2704,6 @@ peer_unfit(
}
-#ifdef ENABLE_FUZZ
-/*
- * Find the precision of this particular machine
- */
-#define MINSTEP 20e-9 /* minimum clock increment (s) */
-#define MAXSTEP 1 /* maximum clock increment (s) */
-#define MINCHANGES 12 /* minimum number of step samples */
-#define MAXLOOPS ((int)(1. / MINSTEP)) /* avoid infinite loop */
-
-/*
- * This routine measures the system precision defined as the minimum of
- * a sequence of differences between successive readings of the system
- * clock. However, if a difference is less than MINSTEP, the clock has
- * been read more than once during a clock tick and the difference is
- * ignored. We set MINSTEP greater than zero in case something happens
- * like a cache miss, and to tolerate underlying system clocks which
- * ensure each reading is strictly greater than prior readings while
- * using an underlying stepping (not interpolated) clock.
- *
- * sys_tick and sys_precision represent the time to read the clock for
- * systems with high-precision clocks, and the tick interval or step
- * size for lower-precision stepping clocks.
- *
- * This routine also measures the time to read the clock on stepping
- * system clocks by counting the number of readings between changes of
- * the underlying clock. With either type of clock, the minimum time
- * to read the clock is saved as sys_fuzz, and used to ensure the
- * get_systime() readings always increase and are fuzzed below sys_fuzz.
- */
-void
-measure_precision(const bool verbose)
-{
- /*
- * With sys_fuzz set to zero, get_systime() fuzzing of low bits
- * is effectively disabled. trunc_os_clock is false to disable
- * get_ostime() simulation of a low-precision system clock.
- */
- set_sys_fuzz(0.);
- trunc_os_clock = false;
- measured_tick = measure_tick_fuzz();
- set_sys_tick_precision(measured_tick);
- if (verbose) {
- msyslog(LOG_INFO, "INIT: precision = %.3f usec (%d)",
- sys_tick * US_PER_S, sys_vars.sys_precision);
- if (sys_fuzz < sys_tick) {
- msyslog(LOG_NOTICE, "INIT: fuzz beneath %.3f usec",
- sys_fuzz * US_PER_S);
- }
- }
-}
-
-
-/*
- * measure_tick_fuzz()
- *
- * measures the minimum time to read the clock (stored in sys_fuzz)
- * and returns the tick, the larger of the minimum increment observed
- * between successive clock readings and the time to read the clock.
- */
-double
-measure_tick_fuzz(void)
-{
- l_fp minstep; /* MINSTEP as l_fp */
- l_fp val; /* current seconds fraction */
- l_fp last; /* last seconds fraction */
- l_fp ldiff; /* val - last */
- double tick; /* computed tick value */
- double diff;
- long repeats;
- long max_repeats;
- int changes;
- int i; /* log2 precision */
-
- tick = MAXSTEP;
- max_repeats = 0;
- repeats = 0;
- changes = 0;
- minstep = dtolfp(MINSTEP);
- get_systime(&last);
- for (i = 0; i < MAXLOOPS && changes < MINCHANGES; i++) {
- get_systime(&val);
- ldiff = val;
- ldiff -= last;
- last = val;
- if (L_ISGT(ldiff, minstep)) {
- max_repeats = max(repeats, max_repeats);
- repeats = 0;
- changes++;
- diff = lfptod(ldiff);
- tick = min(diff, tick);
- } else {
- repeats++;
- }
- }
- if (changes < MINCHANGES) {
- msyslog(LOG_ERR, "PROTO: Fatal error: precision could not be measured (MINSTEP too large?)");
- exit(1);
- }
-
- if (0 == max_repeats) {
- set_sys_fuzz(tick);
- } else {
- set_sys_fuzz(tick / max_repeats);
- }
-
- return tick;
-}
-
-void
-set_sys_tick_precision(
- double tick
- )
-{
- int i;
-
- if (tick > 1.) {
- msyslog(LOG_ERR,
- "INIT: unsupported tick %.3f > 1s ignored", tick);
- return;
- }
- if (tick < measured_tick) {
- msyslog(LOG_ERR,
- "INIT: tick %.3f less than measured tick %.3f, ignored",
- tick, measured_tick);
- return;
- } else if (tick > measured_tick) {
- trunc_os_clock = true;
- msyslog(LOG_NOTICE,
- "INIT: truncating system clock to multiples of %.9f",
- tick);
- }
- sys_tick = tick;
-
- /*
- * Find the nearest power of two.
- */
- for (i = 0; tick <= 1; i--) {
- tick *= 2;
-}
- if (tick - 1 > 1 - tick / 2) {
- i++;
-}
-
- sys_vars.sys_precision = (int8_t)i;
-}
-#endif
/*
* init_proto - initialize the protocol module's data
@@ -2879,12 +2725,8 @@ init_proto(const bool verbose)
sys_vars.sys_rootdisp = 0;
sys_vars.sys_reftime = 0;
clkstate.sys_jitter = 0;
-#ifdef ENABLE_FUZZ
- measure_precision(verbose);
-#else
UNUSED_ARG(verbose);
- sys_vars.sys_precision = -30; /* ns */
-#endif
+ sys_vars.sys_precision = -30; /* ns */ // FIXME FUZZ
get_systime(&dummy);
sys_survivors = 0;
sys_stattime = current_time;
=====================================
ntpd/wscript
=====================================
@@ -124,7 +124,7 @@ def build(ctx):
]
ctx(
- features="c rtems_trace cprogram",
+ features="c cprogram",
includes=[
ctx.bldnode.parent.abspath(), "../include",
"%s/host/ntpd/" % ctx.bldnode.parent.abspath(), "." ],
=====================================
pylib/util.py
=====================================
@@ -80,7 +80,7 @@ def deunicode_units(): # pragma: no cover
S_VARS = ("tai", "poll")
MS_VARS = ("rootdelay", "rootdisp", "rootdist", "offset", "sys_jitter",
"clk_jitter", "leapsmearoffset", "authdelay", "koffset", "kmaxerr",
- "kesterr", "kprecis", "kppsjitter", "fuzz", "clk_wander_threshold",
+ "kesterr", "kprecis", "kppsjitter", "clk_wander_threshold",
"tick", "in", "out", "bias", "delay", "jitter", "dispersion",
"fudgetime1", "fudgetime2")
PPM_VARS = ("frequency", "clk_wander")
=====================================
tests/option-tester.sh
=====================================
@@ -99,7 +99,7 @@ doit minimal "--disable-droproot --disable-mdns-registration --disable-doc --dis
# This also tests refclocks without DEBUG
doit classic "--enable-classic-mode --refclock=all --disable-doc --disable-manpage --enable-pylib=ffi --disable-debug-gdb"
-doit all "--enable-warnings --enable-attic --enable-debug --enable-debug-timing --refclock=all --enable-leap-smear --enable-mssntp --enable-early-droproot --disable-fuzz $LINUX --disable-doc --disable-manpage --enable-pylib=ext"
+doit all "--enable-warnings --enable-attic --enable-debug --enable-debug-timing --refclock=all --enable-leap-smear --enable-mssntp --enable-early-droproot $LINUX --disable-doc --disable-manpage --enable-pylib=ext"
if [ "`command -v asciidoc 2>/dev/null`" != "" -a \
"`command -v xsltproc 2>/dev/null`" != "" ]
=====================================
tests/pylib/test_util.py
=====================================
@@ -841,7 +841,6 @@ class TestPylibUtilMethods(unittest.TestCase):
("authdelay", (6, "6")), ("koffset", (7, "7")),
("kmaxerr", (8, "8")), ("kesterr", (9, "9")),
("kprecis", (10, "10")), ("kppsjitter", (11, "11")),
- ("fuzz", (12, "12")),
("clk_wander_threshold", (13, "13")),
("tick", (14, "14")), ("in", (15, "15")),
("out", (16, "16")), ("bias", (17, "17")),
@@ -851,9 +850,9 @@ class TestPylibUtilMethods(unittest.TestCase):
self.assertEqual(f(data), "rootdelay=0, rootdisp=1, offset=2, "
"sys_jitter=3, clk_jitter=4,\nleapsmearoffset=5, "
"authdelay=6, koffset=7, kmaxerr=8, kesterr=9, "
- "kprecis=10,\nkppsjitter=11, fuzz=12, "
+ "kprecis=10,\nkppsjitter=11, "
"clk_wander_threshold=13, tick=14, in=15, "
- "out=16,\nbias=17, delay=18, jitter=19, "
+ "out=16, bias=17,\ndelay=18, jitter=19, "
"dispersion=20, fudgetime1=21, fudgetime2=21\n")
# Test MS_VARS, with units
self.assertEqual(f(data, showunits=True),
@@ -861,10 +860,10 @@ class TestPylibUtilMethods(unittest.TestCase):
"sys_jitter=3ms, clk_jitter=4ms,\n"
"leapsmearoffset=5ms, authdelay=6ms, "
"koffset=7ms, kmaxerr=8ms, kesterr=9ms,\n"
- "kprecis=10ms, kppsjitter=11ms, fuzz=12ms, "
- "clk_wander_threshold=13ms,\ntick=14ms, in=15ms, "
- "out=16ms, bias=17ms, delay=18ms, jitter=19ms,\n"
- "dispersion=20ms, fudgetime1=21ms, "
+ "kprecis=10ms, kppsjitter=11ms, "
+ "clk_wander_threshold=13ms, tick=14ms, in=15ms,\n"
+ "out=16ms, bias=17ms, delay=18ms, jitter=19ms, "
+ "dispersion=20ms,\nfudgetime1=21ms, "
"fudgetime2=21ms\n")
# Test S_VARS
data = od((("tai", (0, "0")), ("poll", (1, "1"))))
=====================================
wafhelpers/options.py
=====================================
@@ -80,12 +80,8 @@ ext, ffi, or none. defaults to ffi.""", nargs=1)
help="Users should use LDFLAGS in their environment.")
grp.add_option('--check', action='store_true', default=False,
help="Run tests")
- grp.add_option('--enable-rtems-trace', action='store_true',
- default=False, help="Enable RTEMS Trace.")
grp.add_option('--enable-warnings', action='store_true',
default=False, help="Enable annoying CC warnings")
- grp.add_option('--rtems-trace-path', type='string', default="",
- help="Path to rtems-tld.")
grp.add_option(
'--define', type='string', action="callback",
callback=callback_flags,
@@ -95,7 +91,7 @@ ext, ffi, or none. defaults to ffi.""", nargs=1)
help="Force undefinition of symbol.")
grp.add_option('--disable-fuzz', action='store_true',
default=False,
- help="Disable fuzzing of low bits of time")
+ help="Feature gone")
# This option group name needs to exactly match the name from
# waflib/Tools/python.py so this option groups with the other Python
=====================================
wafhelpers/rtems_trace.py deleted
=====================================
@@ -1,13 +0,0 @@
-# Copyright the NTPsec project contributors
-#
-# SPDX-License-Identifier: BSD-2-Clause
-
-from waflib.TaskGen import feature, after_method
-
-
- at feature("rtems_trace")
- at after_method('apply_link')
-def rtems_trace(self):
- if self.env.RTEMS_TEST_ENABLE:
- self.link_task.env.LINK_CC = self.env.BIN_RTEMS_TLD \
- + self.env.RTEMS_TEST_FLAGS + ['--']
=====================================
wscript
=====================================
@@ -148,19 +148,6 @@ def configure(ctx):
for opt in opt_map:
ctx.env[opt] = opt_map[opt]
- if ctx.options.enable_rtems_trace:
- ctx.find_program("rtems-tld", var="BIN_RTEMS_TLD",
- path_list=[ctx.options.rtems_trace_path,
- '${BINDIR}'])
- ctx.env.RTEMS_TEST_ENABLE = True
- ctx.env.RTEMS_TEST_FLAGS = [
- "-C", "%s/devel/trace/ntpsec-trace.ini" % srcnode,
- "-W", "%s/ntpsec-wrapper" % bldnode,
- "-P", "%s/devel/trace/" % srcnode,
- "-f", "-I%s" % bldnode,
- "-f", "-I%s/include/" % srcnode,
- ]
-
# Not needed to build. Used by utility scripts.
ctx.find_program("awk", var="BIN_AWK", mandatory=False)
ctx.find_program("sh", var="BIN_SH", mandatory=False)
@@ -812,9 +799,8 @@ int main(int argc, char **argv) {
if ctx.options.enable_early_droproot:
ctx.define("ENABLE_EARLY_DROPROOT", 1,
comment="Enable early drop root")
- if not ctx.options.disable_fuzz:
- ctx.define("ENABLE_FUZZ", 1,
- comment="Enable fuzzing low bits of time")
+ if ctx.options.disable_fuzz:
+ pprint("YELLOW", "--disable-fuzz is now standard. Clock fuzzing is gone.")
# SO_REUSEADDR socket option is needed to open a socket on an
# interface when the port number is already in use on another
@@ -957,7 +943,6 @@ def bin_test_summary(ctx):
bin_test_summary(ctx)
-# Borrowed from https://www.rtems.org/
variant_cmd = (
("build", BuildContext),
("clean", CleanContext),
@@ -1059,7 +1044,6 @@ def build(ctx):
from waflib.Logs import verbose
ctx.load('waf', tooldir='wafhelpers/')
ctx.load('asciidoc', tooldir='wafhelpers/')
- ctx.load('rtems_trace', tooldir='wafhelpers/')
if ctx.variant == "host":
ctx.recurse("ntpd")
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/c71a75394c0ffbe92455cd71cdaf01f9cdfd26ef...99f1e09462f7b31db65cefed200bd9662571d3c2
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/c71a75394c0ffbe92455cd71cdaf01f9cdfd26ef...99f1e09462f7b31db65cefed200bd9662571d3c2
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20240628/3dbeaff7/attachment-0001.htm>
More information about the vc
mailing list