summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpd
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/ntpd')
-rw-r--r--contrib/ntp/ntpd/invoke-ntp.conf.texi2
-rw-r--r--contrib/ntp/ntpd/invoke-ntp.keys.texi2
-rw-r--r--contrib/ntp/ntpd/invoke-ntpd.texi4
-rw-r--r--contrib/ntp/ntpd/ntp.conf.5man6
-rw-r--r--contrib/ntp/ntpd/ntp.conf.5mdoc4
-rw-r--r--contrib/ntp/ntpd/ntp.conf.html2
-rw-r--r--contrib/ntp/ntpd/ntp.conf.man.in6
-rw-r--r--contrib/ntp/ntpd/ntp.conf.mdoc.in4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.5man4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.5mdoc4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.html2
-rw-r--r--contrib/ntp/ntpd/ntp.keys.man.in4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.mdoc.in4
-rw-r--r--contrib/ntp/ntpd/ntp_control.c10
-rw-r--r--contrib/ntp/ntpd/ntp_crypto.c4
-rw-r--r--contrib/ntp/ntpd/ntp_io.c12
-rw-r--r--contrib/ntp/ntpd/ntp_loopfilter.c46
-rw-r--r--contrib/ntp/ntpd/ntp_parser.c349
-rw-r--r--contrib/ntp/ntpd/ntp_proto.c323
-rw-r--r--contrib/ntp/ntpd/ntp_refclock.c6
-rw-r--r--contrib/ntp/ntpd/ntp_request.c4
-rw-r--r--contrib/ntp/ntpd/ntp_restrict.c4
-rw-r--r--contrib/ntp/ntpd/ntp_signd.c5
-rw-r--r--contrib/ntp/ntpd/ntp_timer.c13
-rw-r--r--contrib/ntp/ntpd/ntp_util.c6
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.c14
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.h6
-rw-r--r--contrib/ntp/ntpd/ntpd.1ntpdman6
-rw-r--r--contrib/ntp/ntpd/ntpd.1ntpdmdoc4
-rw-r--r--contrib/ntp/ntpd/ntpd.c14
-rw-r--r--contrib/ntp/ntpd/ntpd.html4
-rw-r--r--contrib/ntp/ntpd/ntpd.man.in6
-rw-r--r--contrib/ntp/ntpd/ntpd.mdoc.in4
-rw-r--r--contrib/ntp/ntpd/refclock_local.c1
-rw-r--r--contrib/ntp/ntpd/refclock_parse.c4
-rw-r--r--contrib/ntp/ntpd/refclock_shm.c5
-rw-r--r--contrib/ntp/ntpd/refclock_true.c2
-rw-r--r--contrib/ntp/ntpd/refclock_tsyncpci.c2
38 files changed, 464 insertions, 438 deletions
diff --git a/contrib/ntp/ntpd/invoke-ntp.conf.texi b/contrib/ntp/ntpd/invoke-ntp.conf.texi
index 37427d6..32b41e6 100644
--- a/contrib/ntp/ntpd/invoke-ntp.conf.texi
+++ b/contrib/ntp/ntpd/invoke-ntp.conf.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
-# It has been AutoGen-ed October 21, 2015 at 12:38:16 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 7, 2016 at 11:30:49 PM by AutoGen 5.18.5
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
diff --git a/contrib/ntp/ntpd/invoke-ntp.keys.texi b/contrib/ntp/ntpd/invoke-ntp.keys.texi
index 33fdb89..b755d97 100644
--- a/contrib/ntp/ntpd/invoke-ntp.keys.texi
+++ b/contrib/ntp/ntpd/invoke-ntp.keys.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
-# It has been AutoGen-ed October 21, 2015 at 12:38:19 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 7, 2016 at 11:30:52 PM by AutoGen 5.18.5
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore
diff --git a/contrib/ntp/ntpd/invoke-ntpd.texi b/contrib/ntp/ntpd/invoke-ntpd.texi
index a781b26..66ce19d 100644
--- a/contrib/ntp/ntpd/invoke-ntpd.texi
+++ b/contrib/ntp/ntpd/invoke-ntpd.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
-# It has been AutoGen-ed October 21, 2015 at 12:38:21 PM by AutoGen 5.18.5
+# It has been AutoGen-ed January 7, 2016 at 11:30:54 PM by AutoGen 5.18.5
# From the definitions ntpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -142,7 +142,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpd - NTP daemon program - Ver. 4.2.8p4
+ntpd - NTP daemon program - Ver. 4.2.8p5
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/ntpd/ntp.conf.5man b/contrib/ntp/ntpd/ntp.conf.5man
index ee457df4..6e6aa32 100644
--- a/contrib/ntp/ntpd/ntp.conf.5man
+++ b/contrib/ntp/ntpd/ntp.conf.5man
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5man "21 Oct 2015" "4.2.8p4" "File Formats"
+.TH ntp.conf 5man "07 Jan 2016" "4.2.8p5" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9oaqYI/ag-OpaiXI)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8qayqp/ag-Vraqpp)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:01 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:35 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpd/ntp.conf.5mdoc b/contrib/ntp/ntpd/ntp.conf.5mdoc
index a883aab..800e995 100644
--- a/contrib/ntp/ntpd/ntp.conf.5mdoc
+++ b/contrib/ntp/ntpd/ntp.conf.5mdoc
@@ -1,9 +1,9 @@
-.Dd October 21 2015
+.Dd January 7 2016
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:24 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:57 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.conf.html b/contrib/ntp/ntpd/ntp.conf.html
index 1f0c819..d10a88d 100644
--- a/contrib/ntp/ntpd/ntp.conf.html
+++ b/contrib/ntp/ntpd/ntp.conf.html
@@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the configuration file for the NTP Project's
<code>ntpd</code> program.
- <p>This document applies to version 4.2.8p4 of <code>ntp.conf</code>.
+ <p>This document applies to version 4.2.8p5 of <code>ntp.conf</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/ntpd/ntp.conf.man.in b/contrib/ntp/ntpd/ntp.conf.man.in
index 7c8a39f..f701b41 100644
--- a/contrib/ntp/ntpd/ntp.conf.man.in
+++ b/contrib/ntp/ntpd/ntp.conf.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5 "21 Oct 2015" "4.2.8p4" "File Formats"
+.TH ntp.conf 5 "07 Jan 2016" "4.2.8p5" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9oaqYI/ag-OpaiXI)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8qayqp/ag-Vraqpp)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:01 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:35 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpd/ntp.conf.mdoc.in b/contrib/ntp/ntpd/ntp.conf.mdoc.in
index 613ee7a..7ad4cc1 100644
--- a/contrib/ntp/ntpd/ntp.conf.mdoc.in
+++ b/contrib/ntp/ntpd/ntp.conf.mdoc.in
@@ -1,9 +1,9 @@
-.Dd October 21 2015
+.Dd January 7 2016
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:24 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:57 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.5man b/contrib/ntp/ntpd/ntp.keys.5man
index 3e5cb54..bb0028b 100644
--- a/contrib/ntp/ntpd/ntp.keys.5man
+++ b/contrib/ntp/ntpd/ntp.keys.5man
@@ -1,8 +1,8 @@
-.TH ntp.keys 5man "21 Oct 2015" "4.2.8p4" "File Formats"
+.TH ntp.keys 5man "07 Jan 2016" "4.2.8p5" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:08 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:41 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.5mdoc b/contrib/ntp/ntpd/ntp.keys.5mdoc
index 6355a39..9524989 100644
--- a/contrib/ntp/ntpd/ntp.keys.5mdoc
+++ b/contrib/ntp/ntpd/ntp.keys.5mdoc
@@ -1,9 +1,9 @@
-.Dd October 21 2015
+.Dd January 7 2016
.Dt NTP_KEYS 5mdoc File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:28 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:31:00 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.html b/contrib/ntp/ntpd/ntp.keys.html
index 3671aaa..738f9e0 100644
--- a/contrib/ntp/ntpd/ntp.keys.html
+++ b/contrib/ntp/ntpd/ntp.keys.html
@@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the symmetric key file for the NTP Project's
<code>ntpd</code> program.
- <p>This document applies to version 4.2.8p4 of <code>ntp.keys</code>.
+ <p>This document applies to version 4.2.8p5 of <code>ntp.keys</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/ntpd/ntp.keys.man.in b/contrib/ntp/ntpd/ntp.keys.man.in
index bd64756..78d5f09 100644
--- a/contrib/ntp/ntpd/ntp.keys.man.in
+++ b/contrib/ntp/ntpd/ntp.keys.man.in
@@ -1,8 +1,8 @@
-.TH ntp.keys 5 "21 Oct 2015" "4.2.8p4" "File Formats"
+.TH ntp.keys 5 "07 Jan 2016" "4.2.8p5" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:08 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:41 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.mdoc.in b/contrib/ntp/ntpd/ntp.keys.mdoc.in
index 6600d57..40c821e 100644
--- a/contrib/ntp/ntpd/ntp.keys.mdoc.in
+++ b/contrib/ntp/ntpd/ntp.keys.mdoc.in
@@ -1,9 +1,9 @@
-.Dd October 21 2015
+.Dd January 7 2016
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:28 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:31:00 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c
index 7736311..2e174d0 100644
--- a/contrib/ntp/ntpd/ntp_control.c
+++ b/contrib/ntp/ntpd/ntp_control.c
@@ -846,7 +846,7 @@ ctl_error(
u_char errcode
)
{
- int maclen;
+ size_t maclen;
numctlerrors++;
DPRINTF(3, ("sending control error %u\n", errcode));
@@ -1248,10 +1248,10 @@ ctl_flushpkt(
)
{
size_t i;
- int dlen;
- int sendlen;
- int maclen;
- int totlen;
+ size_t dlen;
+ size_t sendlen;
+ size_t maclen;
+ size_t totlen;
keyid_t keyid;
dlen = datapt - rpkt.u.data;
diff --git a/contrib/ntp/ntpd/ntp_crypto.c b/contrib/ntp/ntpd/ntp_crypto.c
index 376b5b5..8574266 100644
--- a/contrib/ntp/ntpd/ntp_crypto.c
+++ b/contrib/ntp/ntpd/ntp_crypto.c
@@ -473,9 +473,9 @@ crypto_recv(
}
/* Check if the declared size fits into the remaining
- * buffer.
+ * buffer. We *know* 'macbytes' > 0 here!
*/
- if (len > macbytes) {
+ if (len > (u_int)macbytes) {
DPRINTF(1, ("crypto_recv: possible attack detected, associd %d\n",
associd));
return XEVNT_LEN;
diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c
index 5fc6ed5..dd23459 100644
--- a/contrib/ntp/ntpd/ntp_io.c
+++ b/contrib/ntp/ntpd/ntp_io.c
@@ -41,6 +41,7 @@
#include "timevalops.h"
#include "timespecops.h"
#include "ntpd-opts.h"
+#include "safecast.h"
/* Don't include ISC's version of IPv6 variables and structures */
#define ISC_IPV6_H 1
@@ -772,7 +773,7 @@ is_ip_address(
hints.ai_flags |= AI_NUMERICHOST;
if (getaddrinfo(tmpbuf, NULL, &hints, &result) == 0) {
AF(addr) = AF_INET6;
- resaddr6 = (struct sockaddr_in6 *)result->ai_addr;
+ resaddr6 = UA_PTR(struct sockaddr_in6, result->ai_addr);
SET_ADDR6N(addr, resaddr6->sin6_addr);
SET_SCOPE(addr, resaddr6->sin6_scope_id);
@@ -3365,7 +3366,7 @@ fetch_timestamp(
#endif /* HAVE_BINTIME */
#ifdef HAVE_TIMESTAMPNS
case SCM_TIMESTAMPNS:
- tsp = (struct timespec *)CMSG_DATA(cmsghdr);
+ tsp = UA_PTR(struct timespec, CMSG_DATA(cmsghdr));
if (sys_tick > measured_tick &&
sys_tick > 1e-9) {
ticks = (unsigned long)((tsp->tv_nsec * 1e-9) /
@@ -3666,8 +3667,7 @@ input_handler(
fds = activefds;
tvzero.tv_sec = tvzero.tv_usec = 0;
- n = select(maxactivefd + 1, &fds, (fd_set *)0, (fd_set *)0,
- &tvzero);
+ n = select(maxactivefd + 1, &fds, NULL, NULL, &tvzero);
/*
* If there are no packets waiting just return
@@ -4447,7 +4447,7 @@ close_and_delete_fd_from_list(
break;
case FD_TYPE_FILE:
- closeserial(lsock->fd);
+ closeserial((int)lsock->fd);
break;
default:
@@ -4643,7 +4643,7 @@ process_routing_msgs(struct asyncio_reader *reader)
* process routing message
*/
#ifdef HAVE_RTNETLINK
- for (nh = (struct nlmsghdr *)buffer;
+ for (nh = UA_PTR(struct nlmsghdr, buffer);
NLMSG_OK(nh, cnt);
nh = NLMSG_NEXT(nh, cnt)) {
msg_type = nh->nlmsg_type;
diff --git a/contrib/ntp/ntpd/ntp_loopfilter.c b/contrib/ntp/ntpd/ntp_loopfilter.c
index 42c30de..4b38aa8 100644
--- a/contrib/ntp/ntpd/ntp_loopfilter.c
+++ b/contrib/ntp/ntpd/ntp_loopfilter.c
@@ -154,7 +154,6 @@ int hardpps_enable; /* kernel PPS discipline enabled */
int ext_enable; /* external clock enabled */
int pps_stratum; /* pps stratum */
int kernel_status; /* from ntp_adjtime */
-int allow_panic = FALSE; /* allow panic correction (-g) */
int force_step_once = FALSE; /* always step time once at startup (-G) */
int mode_ntpdate = FALSE; /* exit on first clock set (-q) */
int freq_cnt; /* initial frequency clamp */
@@ -459,16 +458,16 @@ local_clock(
double dtemp, etemp; /* double temps */
char tbuf[80]; /* report buffer */
+ (void)ntp_adj_ret; /* not always used below... */
/*
* If the loop is opened or the NIST LOCKCLOCK is in use,
* monitor and record the offsets anyway in order to determine
* the open-loop response and then go home.
*/
-#ifdef LOCKCLOCK
+#ifndef LOCKCLOCK
+ if (!ntp_enable)
+#endif /* not LOCKCLOCK */
{
-#else
- if (!ntp_enable) {
-#endif /* LOCKCLOCK */
record_loop_stats(fp_offset, drift_comp, clock_jitter,
clock_stability, sys_poll);
return (0);
@@ -493,6 +492,8 @@ local_clock(
return (-1);
}
+ allow_panic = FALSE;
+
/*
* This section simulates ntpdate. If the offset exceeds the
* step threshold (128 ms), step the clock to that time and
@@ -538,12 +539,8 @@ local_clock(
else
dtemp = (peer->delay - sys_mindly) / 2;
fp_offset += dtemp;
-#ifdef DEBUG
- if (debug)
- printf(
- "local_clock: size %d mindly %.6f huffpuff %.6f\n",
- sys_hufflen, sys_mindly, dtemp);
-#endif
+ DPRINTF(1, ("local_clock: size %d mindly %.6f huffpuff %.6f\n",
+ sys_hufflen, sys_mindly, dtemp));
}
/*
@@ -694,7 +691,6 @@ local_clock(
* startup until the initial transient has subsided.
*/
default:
- allow_panic = FALSE;
if (freq_cnt == 0) {
/*
@@ -921,15 +917,11 @@ local_clock(
*/
record_loop_stats(clock_offset, drift_comp, clock_jitter,
clock_stability, sys_poll);
-#ifdef DEBUG
- if (debug)
- printf(
- "local_clock: offset %.9f jit %.9f freq %.3f stab %.3f poll %d\n",
+ DPRINTF(1, ("local_clock: offset %.9f jit %.9f freq %.3f stab %.3f poll %d\n",
clock_offset, clock_jitter, drift_comp * 1e6,
- clock_stability * 1e6, sys_poll);
-#endif /* DEBUG */
+ clock_stability * 1e6, sys_poll));
return (rval);
-#endif /* LOCKCLOCK */
+#endif /* not LOCKCLOCK */
}
@@ -1005,7 +997,10 @@ adj_host_clock(
* but does not automatically stop slewing when an offset
* has decayed to zero.
*/
+ DEBUG_INSIST(enable_panic_check == TRUE);
+ enable_panic_check = FALSE;
adj_systime(offset_adj + freq_adj);
+ enable_panic_check = TRUE;
#endif /* LOCKCLOCK */
}
@@ -1019,12 +1014,9 @@ rstclock(
double offset /* new offset */
)
{
-#ifdef DEBUG
- if (debug > 1)
- printf("local_clock: mu %lu state %d poll %d count %d\n",
+ DPRINTF(2, ("rstclock: mu %lu state %d poll %d count %d\n",
current_time - clock_epoch, trans, sys_poll,
- tc_counter);
-#endif
+ tc_counter));
if (trans != state && trans != EVNT_FSET)
report_event(trans, NULL, NULL);
state = trans;
@@ -1075,6 +1067,7 @@ set_freq(
const char * loop_desc;
int ntp_adj_ret;
+ (void)ntp_adj_ret; /* not always used below... */
drift_comp = freq;
loop_desc = "ntpd";
#ifdef KERNEL_PLL
@@ -1236,10 +1229,7 @@ loop_config(
int i;
double ftemp;
-#ifdef DEBUG
- if (debug > 1)
- printf("loop_config: item %d freq %f\n", item, freq);
-#endif
+ DPRINTF(2, ("loop_config: item %d freq %f\n", item, freq));
switch (item) {
/*
diff --git a/contrib/ntp/ntpd/ntp_parser.c b/contrib/ntp/ntpd/ntp_parser.c
index 6235033..cc17950 100644
--- a/contrib/ntp/ntpd/ntp_parser.c
+++ b/contrib/ntp/ntpd/ntp_parser.c
@@ -889,21 +889,21 @@ static const yytype_uint16 yyrline[] =
872, 873, 874, 875, 876, 877, 878, 879, 880, 881,
882, 886, 891, 899, 904, 905, 906, 910, 915, 923,
928, 929, 930, 931, 932, 933, 934, 935, 943, 953,
- 958, 966, 968, 970, 972, 974, 979, 980, 984, 985,
- 986, 987, 995, 1000, 1005, 1013, 1018, 1019, 1020, 1029,
- 1031, 1036, 1041, 1049, 1051, 1068, 1069, 1070, 1071, 1072,
- 1073, 1077, 1078, 1086, 1091, 1096, 1104, 1109, 1110, 1111,
- 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1127, 1128, 1129,
- 1136, 1143, 1150, 1166, 1185, 1187, 1189, 1191, 1193, 1195,
- 1202, 1207, 1208, 1209, 1213, 1217, 1226, 1227, 1231, 1232,
- 1233, 1237, 1248, 1262, 1274, 1279, 1281, 1286, 1287, 1295,
- 1297, 1305, 1310, 1318, 1343, 1350, 1360, 1361, 1365, 1366,
- 1367, 1368, 1372, 1373, 1374, 1378, 1383, 1388, 1396, 1397,
- 1398, 1399, 1400, 1401, 1402, 1412, 1417, 1425, 1430, 1438,
- 1440, 1444, 1449, 1454, 1462, 1467, 1475, 1484, 1485, 1489,
- 1490, 1499, 1517, 1521, 1526, 1534, 1539, 1540, 1544, 1549,
- 1557, 1562, 1567, 1572, 1577, 1585, 1590, 1595, 1603, 1608,
- 1609, 1610, 1611, 1612
+ 958, 966, 968, 970, 979, 981, 986, 987, 991, 992,
+ 993, 994, 1002, 1007, 1012, 1020, 1025, 1026, 1027, 1036,
+ 1038, 1043, 1048, 1056, 1058, 1075, 1076, 1077, 1078, 1079,
+ 1080, 1084, 1085, 1093, 1098, 1103, 1111, 1116, 1117, 1118,
+ 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1134, 1135, 1136,
+ 1143, 1150, 1157, 1173, 1192, 1194, 1196, 1198, 1200, 1202,
+ 1209, 1214, 1215, 1216, 1220, 1224, 1233, 1234, 1238, 1239,
+ 1240, 1244, 1255, 1269, 1281, 1286, 1288, 1293, 1294, 1302,
+ 1304, 1312, 1317, 1325, 1350, 1357, 1367, 1368, 1372, 1373,
+ 1374, 1375, 1379, 1380, 1381, 1385, 1390, 1395, 1403, 1404,
+ 1405, 1406, 1407, 1408, 1409, 1419, 1424, 1432, 1437, 1445,
+ 1447, 1451, 1456, 1461, 1469, 1474, 1482, 1491, 1492, 1496,
+ 1497, 1506, 1524, 1528, 1533, 1541, 1546, 1547, 1551, 1556,
+ 1564, 1569, 1574, 1579, 1584, 1592, 1597, 1602, 1610, 1615,
+ 1616, 1617, 1618, 1619
};
#endif
@@ -2684,90 +2684,97 @@ yyreduce:
case 173:
#line 971 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
- { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2689 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+ {
+ if ((yyvsp[0].Integer) >= 0 && (yyvsp[0].Integer) <= 16) {
+ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
+ } else {
+ (yyval.Attr_val) = NULL;
+ yyerror("fudge factor: stratum value not in [0..16], ignored");
+ }
+ }
+#line 2696 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 174:
-#line 973 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 980 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2695 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2702 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 175:
-#line 975 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 982 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2701 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2708 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 182:
-#line 996 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1003 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); }
-#line 2707 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2714 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 183:
-#line 1001 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1008 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2716 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2723 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 184:
-#line 1006 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1013 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2725 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2732 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 185:
-#line 1014 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1021 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2731 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2738 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 189:
-#line 1030 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1037 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); }
-#line 2737 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2744 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 190:
-#line 1032 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1039 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); }
-#line 2743 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2750 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 191:
-#line 1037 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1044 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2752 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2759 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 192:
-#line 1042 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1049 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2761 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2768 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 193:
-#line 1050 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1057 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2767 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2774 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 194:
-#line 1052 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1059 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
(yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
@@ -2781,74 +2788,74 @@ yyreduce:
yyerror(err_str);
}
}
-#line 2785 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2792 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 203:
-#line 1087 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1094 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); }
-#line 2791 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2798 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 204:
-#line 1092 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1099 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2800 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2807 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 205:
-#line 1097 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1104 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2809 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2816 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 206:
-#line 1105 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1112 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2815 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2822 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 219:
-#line 1130 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1137 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *av;
av = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double));
APPEND_G_FIFO(cfgt.vars, av);
}
-#line 2826 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2833 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 220:
-#line 1137 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1144 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *av;
av = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
APPEND_G_FIFO(cfgt.vars, av);
}
-#line 2837 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2844 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 221:
-#line 1144 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1151 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *av;
av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
APPEND_G_FIFO(cfgt.vars, av);
}
-#line 2848 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2855 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 222:
-#line 1151 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1158 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
char error_text[64];
attr_val *av;
@@ -2864,11 +2871,11 @@ yyreduce:
yyerror(error_text);
}
}
-#line 2868 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2875 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 223:
-#line 1167 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1174 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (!lex_from_file()) {
YYFREE((yyvsp[-1].String)); /* avoid leak */
@@ -2887,68 +2894,68 @@ yyreduce:
}
YYFREE((yyvsp[-1].String)); /* avoid leak */
}
-#line 2891 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2898 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 224:
-#line 1186 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1193 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ lex_flush_stack(); }
-#line 2897 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2904 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 225:
-#line 1188 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1195 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ /* see drift_parm below for actions */ }
-#line 2903 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2910 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 226:
-#line 1190 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1197 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); }
-#line 2909 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2916 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 227:
-#line 1192 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1199 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); }
-#line 2915 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2922 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 228:
-#line 1194 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1201 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); }
-#line 2921 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2928 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 229:
-#line 1196 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1203 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
addr_opts_node *aon;
aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.trap, aon);
}
-#line 2932 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2939 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 230:
-#line 1203 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1210 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); }
-#line 2938 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2945 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 235:
-#line 1218 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1225 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
#ifndef LEAP_SMEAR
yyerror("Built without LEAP_SMEAR support.");
#endif
}
-#line 2948 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2955 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 241:
-#line 1238 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1245 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
attr_val *av;
@@ -2959,11 +2966,11 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 2963 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2970 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 242:
-#line 1249 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1256 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
attr_val *av;
@@ -2976,11 +2983,11 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 2980 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 2987 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 243:
-#line 1262 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1269 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
attr_val *av;
@@ -2990,71 +2997,71 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 2994 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3001 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 244:
-#line 1275 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1282 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); }
-#line 3000 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3007 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 246:
-#line 1281 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1288 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 0; }
-#line 3006 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3013 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 247:
-#line 1286 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1293 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
-#line 3012 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3019 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 248:
-#line 1288 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1295 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3021 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3028 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 249:
-#line 1296 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1303 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 3027 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3034 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 250:
-#line 1298 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1305 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), estrdup((yyvsp[0].Address_node)->address));
destroy_address_node((yyvsp[0].Address_node));
}
-#line 3036 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3043 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 251:
-#line 1306 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1313 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3045 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3052 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 252:
-#line 1311 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1318 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3054 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3061 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 253:
-#line 1319 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1326 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
char prefix;
char * type;
@@ -3076,141 +3083,141 @@ yyreduce:
(yyval.Attr_val) = create_attr_sval(prefix, estrdup(type));
YYFREE((yyvsp[0].String));
}
-#line 3080 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3087 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 254:
-#line 1344 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1351 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
nic_rule_node *nrn;
nrn = create_nic_rule_node((yyvsp[0].Integer), NULL, (yyvsp[-1].Integer));
APPEND_G_FIFO(cfgt.nic_rules, nrn);
}
-#line 3091 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3098 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 255:
-#line 1351 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1358 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
nic_rule_node *nrn;
nrn = create_nic_rule_node(0, (yyvsp[0].String), (yyvsp[-1].Integer));
APPEND_G_FIFO(cfgt.nic_rules, nrn);
}
-#line 3102 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3109 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 265:
-#line 1379 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1386 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); }
-#line 3108 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3115 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 266:
-#line 1384 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1391 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
-#line 3117 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3124 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 267:
-#line 1389 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1396 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Int_fifo) = NULL;
APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
-#line 3126 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3133 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 275:
-#line 1413 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1420 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
}
-#line 3135 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3142 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 276:
-#line 1418 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1425 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
}
-#line 3144 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3151 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 277:
-#line 1426 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1433 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3153 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3160 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 278:
-#line 1431 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1438 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3162 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3169 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 279:
-#line 1439 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1446 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); }
-#line 3168 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3175 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 281:
-#line 1445 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1452 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); }
-#line 3174 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3181 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 282:
-#line 1450 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1457 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.String_fifo) = (yyvsp[-1].String_fifo);
APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
}
-#line 3183 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3190 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 283:
-#line 1455 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1462 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.String_fifo) = NULL;
APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
}
-#line 3192 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3199 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 284:
-#line 1463 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1470 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Address_fifo) = (yyvsp[-1].Address_fifo);
APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
}
-#line 3201 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3208 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 285:
-#line 1468 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1475 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Address_fifo) = NULL;
APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
}
-#line 3210 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3217 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 286:
-#line 1476 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1483 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if ((yyvsp[0].Integer) != 0 && (yyvsp[0].Integer) != 1) {
yyerror("Integer value is not boolean (0 or 1). Assuming 1");
@@ -3219,29 +3226,29 @@ yyreduce:
(yyval.Integer) = (yyvsp[0].Integer);
}
}
-#line 3223 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3230 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 287:
-#line 1484 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1491 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 1; }
-#line 3229 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3236 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 288:
-#line 1485 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1492 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 0; }
-#line 3235 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3242 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 289:
-#line 1489 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1496 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Double) = (double)(yyvsp[0].Integer); }
-#line 3241 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3248 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 291:
-#line 1500 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1507 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
sim_node *sn;
@@ -3251,125 +3258,125 @@ yyreduce:
/* Revert from ; to \n for end-of-command */
old_config_style = 1;
}
-#line 3255 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3262 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 292:
-#line 1517 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1524 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ old_config_style = 0; }
-#line 3261 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3268 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 293:
-#line 1522 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1529 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
-#line 3270 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3277 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 294:
-#line 1527 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1534 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
-#line 3279 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3286 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 295:
-#line 1535 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1542 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
-#line 3285 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3292 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 298:
-#line 1545 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1552 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_server_fifo) = (yyvsp[-1].Sim_server_fifo);
APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
}
-#line 3294 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3301 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 299:
-#line 1550 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1557 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_server_fifo) = NULL;
APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
}
-#line 3303 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3310 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 300:
-#line 1558 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1565 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[-4].Address_node), (yyvsp[-2].Double), (yyvsp[-1].Sim_script_fifo))); }
-#line 3309 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3316 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 301:
-#line 1563 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1570 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Double) = (yyvsp[-1].Double); }
-#line 3315 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3322 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 302:
-#line 1568 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1575 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Address_node) = (yyvsp[0].Address_node); }
-#line 3321 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3328 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 303:
-#line 1573 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1580 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_script_fifo) = (yyvsp[-1].Sim_script_fifo);
APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
}
-#line 3330 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3337 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 304:
-#line 1578 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1585 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_script_fifo) = NULL;
APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
}
-#line 3339 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3346 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 305:
-#line 1586 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1593 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); }
-#line 3345 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3352 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 306:
-#line 1591 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1598 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
-#line 3354 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3361 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 307:
-#line 1596 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1603 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
-#line 3363 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3370 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 308:
-#line 1604 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1611 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
-#line 3369 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3376 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
-#line 3373 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
+#line 3380 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3597,7 +3604,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1615 "../../ntpd/ntp_parser.y" /* yacc.c:1906 */
+#line 1622 "../../ntpd/ntp_parser.y" /* yacc.c:1906 */
void
diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c
index 2a15d72..f770472 100644
--- a/contrib/ntp/ntpd/ntp_proto.c
+++ b/contrib/ntp/ntpd/ntp_proto.c
@@ -15,6 +15,7 @@
#include "ntp_string.h"
#include "ntp_leapsec.h"
#include "refidsmear.h"
+#include "lib_strbuf.h"
#include <stdio.h>
#ifdef HAVE_LIBSCF_H
@@ -172,8 +173,14 @@ void pool_name_resolved (int, int, void *, const char *,
const struct addrinfo *);
#endif /* WORKER */
+const char * amtoa (int am);
+
+
void
-set_sys_leap(u_char new_sys_leap) {
+set_sys_leap(
+ u_char new_sys_leap
+ )
+{
sys_leap = new_sys_leap;
xmt_leap = sys_leap;
@@ -189,8 +196,9 @@ set_sys_leap(u_char new_sys_leap) {
#ifdef LEAP_SMEAR
else {
/*
- * If leap smear is enabled in general we must never send a leap second warning
- * to clients, so make sure we only send "in sync".
+ * If leap smear is enabled in general we must
+ * never send a leap second warning to clients,
+ * so make sure we only send "in sync".
*/
if (leap_smear.enabled)
xmt_leap = LEAP_NOWARNING;
@@ -199,34 +207,39 @@ set_sys_leap(u_char new_sys_leap) {
}
}
+
/*
* Kiss Code check
*/
-int kiss_code_check(u_char hisleap, u_char hisstratum, u_char hismode, u_int32 refid) {
+int
+kiss_code_check(
+ u_char hisleap,
+ u_char hisstratum,
+ u_char hismode,
+ u_int32 refid
+ )
+{
- if ( hismode == MODE_SERVER
- && hisleap == LEAP_NOTINSYNC
- && hisstratum == STRATUM_UNSPEC) {
- if(memcmp(&refid,"RATE", 4) == 0) {
- return (RATEKISS);
- }
- else if(memcmp(&refid,"DENY", 4) == 0) {
- return (DENYKISS);
- }
- else if(memcmp(&refid,"RSTR", 4) == 0) {
- return (RSTRKISS);
- }
- else if(memcmp(&refid,"X", 1) == 0) {
- return (XKISS);
- }
- else {
- return (UNKNOWNKISS);
- }
- }
- else {
- return (NOKISS);
+ if ( hismode == MODE_SERVER
+ && hisleap == LEAP_NOTINSYNC
+ && hisstratum == STRATUM_UNSPEC) {
+ if(memcmp(&refid,"RATE", 4) == 0) {
+ return (RATEKISS);
+ } else if(memcmp(&refid,"DENY", 4) == 0) {
+ return (DENYKISS);
+ } else if(memcmp(&refid,"RSTR", 4) == 0) {
+ return (RSTRKISS);
+ } else if(memcmp(&refid,"X", 1) == 0) {
+ return (XKISS);
+ } else {
+ return (UNKNOWNKISS);
}
+ } else {
+ return (NOKISS);
+ }
}
+
+
/*
* transmit - transmit procedure called by poll timeout
*/
@@ -303,7 +316,7 @@ transmit(
peer->outdate = current_time;
if ( (peer_associations <= 2 * sys_maxclock)
&& ( peer_associations < sys_maxclock
- || sys_survivors < sys_minclock))
+ || sys_survivors < sys_minclock))
pool_xmit(peer);
poll_update(peer, hpoll);
return;
@@ -416,6 +429,33 @@ transmit(
if (peer->hmode != MODE_BCLIENT)
peer_xmit(peer);
poll_update(peer, hpoll);
+
+ return;
+}
+
+
+const char *
+amtoa(
+ int am
+ )
+{
+ char *bp;
+
+ switch(am) {
+ case AM_ERR: return "AM_ERR";
+ case AM_NOMATCH: return "AM_NOMATCH";
+ case AM_PROCPKT: return "AM_PROCPKT";
+ case AM_BCST: return "AM_BCST";
+ case AM_FXMIT: return "AM_FXMIT";
+ case AM_MANYCAST: return "AM_MANYCAST";
+ case AM_NEWPASS: return "AM_NEWPASS";
+ case AM_NEWBCL: return "AM_NEWBCL";
+ case AM_POSSBCL: return "AM_POSSBCL";
+ default:
+ LIB_GETBUF(bp);
+ snprintf(bp, LIB_BUFLENGTH, "AM_#%d", am);
+ return bp;
+ }
}
@@ -434,16 +474,18 @@ receive(
u_char hismode; /* packet mode */
u_char hisstratum; /* packet stratum */
u_short restrict_mask; /* restrict bits */
- int kissCode = NOKISS; /* Kiss Code */
+ const char *hm_str; /* hismode string */
+ const char *am_str; /* association match string */
+ int kissCode = NOKISS; /* Kiss Code */
int has_mac; /* length of MAC field */
int authlen; /* offset of MAC field */
int is_authentic = 0; /* cryptosum ok */
int retcode = AM_NOMATCH; /* match code */
keyid_t skeyid = 0; /* key IDs */
u_int32 opcode = 0; /* extension field opcode */
- sockaddr_u *dstadr_sin; /* active runway */
+ sockaddr_u *dstadr_sin; /* active runway */
struct peer *peer2; /* aux peer structure pointer */
- endpt * match_ep; /* newpeer() local address */
+ endpt *match_ep; /* newpeer() local address */
l_fp p_org; /* origin timestamp */
l_fp p_rec; /* receive timestamp */
l_fp p_xmt; /* transmit timestamp */
@@ -474,11 +516,12 @@ receive(
return; /* bogus port */
}
restrict_mask = restrictions(&rbufp->recv_srcadr);
- DPRINTF(2, ("receive: at %ld %s<-%s flags %x restrict %03x\n",
- current_time, stoa(&rbufp->dstadr->sin),
- stoa(&rbufp->recv_srcadr),
- rbufp->dstadr->flags, restrict_mask));
pkt = &rbufp->recv_pkt;
+ DPRINTF(2, ("receive: at %ld %s<-%s flags %x restrict %03x org %#010x.%08x xmt %#010x.%08x\n",
+ current_time, stoa(&rbufp->dstadr->sin),
+ stoa(&rbufp->recv_srcadr), rbufp->dstadr->flags,
+ restrict_mask, ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
+ ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf)));
hisversion = PKT_VERSION(pkt->li_vn_mode);
hisleap = PKT_LEAP(pkt->li_vn_mode);
hismode = (int)PKT_MODE(pkt->li_vn_mode);
@@ -685,6 +728,8 @@ receive(
NTOHL_FP(&pkt->org, &p_org);
NTOHL_FP(&pkt->rec, &p_rec);
NTOHL_FP(&pkt->xmt, &p_xmt);
+ hm_str = modetoa(hismode);
+ am_str = amtoa(retcode);
/*
* Authentication is conditioned by three switches:
@@ -713,25 +758,21 @@ receive(
if (has_mac == 0) {
restrict_mask &= ~RES_MSSNTP;
is_authentic = AUTH_NONE; /* not required */
-#ifdef DEBUG
- if (debug)
- printf(
- "receive: at %ld %s<-%s mode %d len %d\n",
+ DPRINTF(2, ("receive: at %ld %s<-%s mode %d/%s:%s len %d org %#010x.%08x xmt %#010x.%08x NOMAC\n",
current_time, stoa(dstadr_sin),
- stoa(&rbufp->recv_srcadr), hismode,
- authlen);
-#endif
+ stoa(&rbufp->recv_srcadr), hismode, hm_str, am_str,
+ authlen,
+ ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
+ ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf)));
} else if (has_mac == 4) {
restrict_mask &= ~RES_MSSNTP;
is_authentic = AUTH_CRYPTO; /* crypto-NAK */
-#ifdef DEBUG
- if (debug)
- printf(
- "receive: at %ld %s<-%s mode %d keyid %08x len %d auth %d\n",
+ DPRINTF(2, ("receive: at %ld %s<-%s mode %d/%s:%s keyid %08x len %d auth %d org %#010x.%08x xmt %#010x.%08x MAC4\n",
current_time, stoa(dstadr_sin),
- stoa(&rbufp->recv_srcadr), hismode, skeyid,
- authlen + has_mac, is_authentic);
-#endif
+ stoa(&rbufp->recv_srcadr), hismode, hm_str, am_str,
+ skeyid, authlen + has_mac, is_authentic,
+ ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
+ ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf)));
#ifdef HAVE_NTP_SIGND
/*
@@ -747,7 +788,7 @@ receive(
&& (restrict_mask & RES_MSSNTP)
&& (retcode == AM_FXMIT || retcode == AM_NEWPASS)
&& (memcmp(zero_key, (char *)pkt + authlen + 4,
- MAX_MD5_LEN - 4) == 0)) {
+ MAX_MD5_LEN - 4) == 0)) {
is_authentic = AUTH_NONE;
#endif /* HAVE_NTP_SIGND */
@@ -856,14 +897,12 @@ receive(
if (crypto_flags && skeyid > NTP_MAXKEY)
authtrust(skeyid, 0);
#endif /* AUTOKEY */
-#ifdef DEBUG
- if (debug)
- printf(
- "receive: at %ld %s<-%s mode %d keyid %08x len %d auth %d\n",
+ DPRINTF(2, ("receive: at %ld %s<-%s mode %d/%s:%s keyid %08x len %d auth %d org %#010x.%08x xmt %#010x.%08x\n",
current_time, stoa(dstadr_sin),
- stoa(&rbufp->recv_srcadr), hismode, skeyid,
- authlen + has_mac, is_authentic);
-#endif
+ stoa(&rbufp->recv_srcadr), hismode, hm_str, am_str,
+ skeyid, authlen + has_mac, is_authentic,
+ ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
+ ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf)));
}
/*
@@ -1194,11 +1233,11 @@ receive(
* debug-printed and not logged to avoid log
* flooding.
*/
- DPRINTF(1, ("receive: at %ld refusing to mobilize passive association"
- " with unknown peer %s mode %d keyid %08x len %d auth %d\n",
+ DPRINTF(2, ("receive: at %ld refusing to mobilize passive association"
+ " with unknown peer %s mode %d/%s:%s keyid %08x len %d auth %d\n",
current_time, stoa(&rbufp->recv_srcadr),
- hismode, skeyid, (authlen + has_mac),
- is_authentic));
+ hismode, hm_str, am_str, skeyid,
+ (authlen + has_mac), is_authentic));
sys_declined++;
return;
}
@@ -1321,26 +1360,36 @@ receive(
}
/*
- * Check for bogus packet in basic mode. If found, switch to
- * interleaved mode and resynchronize, but only after confirming
- * the packet is not bogus in symmetric interleaved mode.
+ * Basic mode checks:
+ *
+ * If there is no origin timestamp, it's an initial packet.
+ *
+ * Otherwise, check for bogus packet in basic mode.
+ * If it is bogus, switch to interleaved mode and resynchronize,
+ * but only after confirming the packet is not bogus in
+ * symmetric interleaved mode.
*
* This could also mean somebody is forging packets claiming to
* be from us, attempting to cause our server to KoD us.
*/
} else if (peer->flip == 0) {
- if (!L_ISEQU(&p_org, &peer->aorg)) {
+ if (0 < hisstratum && L_ISZERO(&p_org)) {
+ L_CLR(&peer->aorg);
+ } else if (!L_ISEQU(&p_org, &peer->aorg)) {
peer->bogusorg++;
peer->flash |= TEST2; /* bogus */
msyslog(LOG_INFO,
- "receive: Unexpected origin timestamp from %s",
- ntoa(&peer->srcadr));
+ "receive: Unexpected origin timestamp %#010x.%08x from %s xmt %#010x.%08x",
+ ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
+ ntoa(&peer->srcadr),
+ ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf));
if ( !L_ISZERO(&peer->dst)
&& L_ISEQU(&p_org, &peer->dst)) {
+ /* Might be the start of an interleave */
peer->flip = 1;
report_event(PEVNT_XLEAVE, peer, NULL);
}
- return; /* Bogus packet, we are done */
+ return; /* Bogus or possible interleave packet */
} else {
L_CLR(&peer->aorg);
}
@@ -1694,11 +1743,8 @@ process_packet(
*/
if (peer->flash & PKT_TEST_MASK) {
peer->seldisptoolarge++;
-#ifdef DEBUG
- if (debug)
- printf("packet: flash header %04x\n",
- peer->flash);
-#endif
+ DPRINTF(1, ("packet: flash header %04x\n",
+ peer->flash));
return;
}
@@ -1871,15 +1917,12 @@ process_packet(
* the roundtrip delay. Then it calculates the correction as a
* fraction of d.
*/
- peer->t21 = t21;
+ peer->t21 = t21;
peer->t21_last = peer->t21_bytes;
peer->t34 = -t34;
peer->t34_bytes = len;
-#ifdef DEBUG
- if (debug > 1)
- printf("packet: t21 %.9lf %d t34 %.9lf %d\n", peer->t21,
- peer->t21_bytes, peer->t34, peer->t34_bytes);
-#endif
+ DPRINTF(2, ("packet: t21 %.9lf %d t34 %.9lf %d\n", peer->t21,
+ peer->t21_bytes, peer->t34, peer->t34_bytes));
if (peer->r21 > 0 && peer->r34 > 0 && p_del > 0) {
if (peer->pmode != MODE_BROADCAST)
td = (peer->r34 / (peer->r21 + peer->r34) -
@@ -1888,7 +1931,7 @@ process_packet(
td = 0;
/*
- * Unfortunately, in many cases the errors are
+ * Unfortunately, in many cases the errors are
* unacceptable, so for the present the rates are not
* used. In future, we might find conditions where the
* calculations are useful, so this should be considered
@@ -1896,12 +1939,9 @@ process_packet(
*/
t21 -= td;
t34 -= td;
-#ifdef DEBUG
- if (debug > 1)
- printf("packet: del %.6lf r21 %.1lf r34 %.1lf %.6lf\n",
+ DPRINTF(2, ("packet: del %.6lf r21 %.1lf r34 %.1lf %.6lf\n",
p_del, peer->r21 / 1e3, peer->r34 / 1e3,
- td);
-#endif
+ td));
}
#endif /* ASSYM */
@@ -1994,12 +2034,8 @@ clock_update(
sys_rootdelay = peer->delay + peer->rootdelay;
sys_reftime = peer->dst;
-#ifdef DEBUG
- if (debug)
- printf(
- "clock_update: at %lu sample %lu associd %d\n",
- current_time, peer->epoch, peer->associd);
-#endif
+ DPRINTF(1, ("clock_update: at %lu sample %lu associd %d\n",
+ current_time, peer->epoch, peer->associd));
/*
* Comes now the moment of truth. Crank the clock discipline and
@@ -2308,13 +2344,9 @@ peer_clear(
#ifdef AUTOKEY
peer->refresh = current_time + (1 << NTP_REFRESH);
#endif /* AUTOKEY */
-#ifdef DEBUG
- if (debug)
- printf(
- "peer_clear: at %ld next %ld associd %d refid %s\n",
+ DPRINTF(1, ("peer_clear: at %ld next %ld associd %d refid %s\n",
current_time, peer->nextdate, peer->associd,
- ident);
-#endif
+ ident));
}
@@ -2478,11 +2510,8 @@ clock_filter(
* packets.
*/
if (peer->filter_epoch[k] <= peer->epoch) {
-#if DEBUG
- if (debug > 1)
- printf("clock_filter: old sample %lu\n", current_time -
- peer->filter_epoch[k]);
-#endif
+ DPRINTF(2, ("clock_filter: old sample %lu\n", current_time -
+ peer->filter_epoch[k]));
return;
}
peer->epoch = peer->filter_epoch[k];
@@ -2494,13 +2523,9 @@ clock_filter(
*/
record_peer_stats(&peer->srcadr, ctlpeerstatus(peer),
peer->offset, peer->delay, peer->disp, peer->jitter);
-#ifdef DEBUG
- if (debug)
- printf(
- "clock_filter: n %d off %.6f del %.6f dsp %.6f jit %.6f\n",
+ DPRINTF(1, ("clock_filter: n %d off %.6f del %.6f dsp %.6f jit %.6f\n",
m, peer->offset, peer->delay, peer->disp,
- peer->jitter);
-#endif
+ peer->jitter));
if (peer->burst == 0 || sys_leap == LEAP_NOTINSYNC)
clock_select();
}
@@ -3004,7 +3029,7 @@ clock_select(void)
typesystem = typepps;
sys_clockhop = 0;
typesystem->new_status = CTL_PST_SEL_PPS;
- sys_offset = typesystem->offset;
+ sys_offset = typesystem->offset;
sys_jitter = typesystem->jitter;
DPRINTF(1, ("select: pps offset %.9f jitter %.9f\n",
sys_offset, sys_jitter));
@@ -3157,11 +3182,11 @@ peer_xmit(
* might not be usable.
*/
sendlen = LEN_PKT_NOMAC;
+ if (
#ifdef AUTOKEY
- if (!(peer->flags & FLAG_SKEY) && peer->keyid == 0) {
-#else /* !AUTOKEY follows */
- if (peer->keyid == 0) {
+ !(peer->flags & FLAG_SKEY) &&
#endif /* !AUTOKEY */
+ peer->keyid == 0) {
/*
* Transmit a-priori timestamps
@@ -3207,13 +3232,11 @@ peer_xmit(
}
L_SUB(&xmt_ty, &xmt_tx);
LFPTOD(&xmt_ty, peer->xleave);
-#ifdef DEBUG
- if (debug)
- printf("transmit: at %ld %s->%s mode %d len %zu\n",
- current_time, peer->dstadr ?
- stoa(&peer->dstadr->sin) : "-",
- stoa(&peer->srcadr), peer->hmode, sendlen);
-#endif
+ DPRINTF(1, ("peer_xmit: at %ld %s->%s mode %d len %zu xmt %#010x.%08x\n",
+ current_time,
+ peer->dstadr ? stoa(&peer->dstadr->sin) : "-",
+ stoa(&peer->srcadr), peer->hmode, sendlen,
+ xmt_tx.l_ui, xmt_tx.l_uf));
return;
}
@@ -3498,7 +3521,7 @@ peer_xmit(
authtrust(xkeyid, 0);
#endif /* AUTOKEY */
if (sendlen > sizeof(xpkt)) {
- msyslog(LOG_ERR, "proto: buffer overflow %zu", sendlen);
+ msyslog(LOG_ERR, "peer_xmit: buffer overflow %zu", sendlen);
exit (-1);
}
peer->t21_bytes = sendlen;
@@ -3521,30 +3544,33 @@ peer_xmit(
L_SUB(&xmt_ty, &xmt_tx);
LFPTOD(&xmt_ty, peer->xleave);
#ifdef AUTOKEY
-#ifdef DEBUG
- if (debug)
- printf("transmit: at %ld %s->%s mode %d keyid %08x len %zu index %d\n",
+ DPRINTF(1, ("peer_xmit: at %ld %s->%s mode %d keyid %08x len %zu index %d\n",
current_time, latoa(peer->dstadr),
ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen,
- peer->keynumber);
-#endif
+ peer->keynumber));
#else /* !AUTOKEY follows */
-#ifdef DEBUG
- if (debug)
- printf("transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
+ DPRINTF(1, ("peer_xmit: at %ld %s->%s mode %d keyid %08x len %d\n",
current_time, peer->dstadr ?
ntoa(&peer->dstadr->sin) : "-",
- ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen);
-#endif
+ ntoa(&peer->srcadr), peer->hmode, xkeyid, sendlen));
#endif /* !AUTOKEY */
+
+ return;
}
#ifdef LEAP_SMEAR
static void
-leap_smear_add_offs(l_fp *t, l_fp *t_recv) {
+leap_smear_add_offs(
+ l_fp *t,
+ l_fp *t_recv
+ )
+{
+
L_ADD(t, &leap_smear.offset);
+
+ return;
}
#endif /* LEAP_SMEAR */
@@ -3565,7 +3591,7 @@ fast_xmit(
struct pkt xpkt; /* transmit packet structure */
struct pkt *rpkt; /* receive packet structure */
l_fp xmt_tx, xmt_ty;
- int sendlen;
+ size_t sendlen;
#ifdef AUTOKEY
u_int32 temp32;
#endif
@@ -3684,13 +3710,10 @@ fast_xmit(
if (rbufp->recv_length == sendlen) {
sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, 0, &xpkt,
sendlen);
-#ifdef DEBUG
- if (debug)
- printf(
- "transmit: at %ld %s->%s mode %d len %d\n",
+ DPRINTF(1, ("fast_xmit: at %ld %s->%s mode %d len %lu\n",
current_time, stoa(&rbufp->dstadr->sin),
- stoa(&rbufp->recv_srcadr), xmode, sendlen);
-#endif
+ stoa(&rbufp->recv_srcadr), xmode,
+ (u_long)sendlen));
return;
}
@@ -3717,7 +3740,7 @@ fast_xmit(
*/
cookie = session_key(&rbufp->recv_srcadr,
&rbufp->dstadr->sin, 0, sys_private, 0);
- if (rbufp->recv_length > sendlen + (int)MAX_MAC_LEN) {
+ if ((size_t)rbufp->recv_length > sendlen + MAX_MAC_LEN) {
session_key(&rbufp->dstadr->sin,
&rbufp->recv_srcadr, xkeyid, 0, 2);
temp32 = CRYPTO_RESP;
@@ -3741,13 +3764,10 @@ fast_xmit(
get_systime(&xmt_ty);
L_SUB(&xmt_ty, &xmt_tx);
sys_authdelay = xmt_ty;
-#ifdef DEBUG
- if (debug)
- printf(
- "transmit: at %ld %s->%s mode %d keyid %08x len %d\n",
+ DPRINTF(1, ("fast_xmit: at %ld %s->%s mode %d keyid %08x len %lu\n",
current_time, ntoa(&rbufp->dstadr->sin),
- ntoa(&rbufp->recv_srcadr), xmode, xkeyid, sendlen);
-#endif
+ ntoa(&rbufp->recv_srcadr), xmode, xkeyid,
+ (u_long)sendlen));
}
@@ -3827,11 +3847,8 @@ pool_xmit(
LEN_PKT_NOMAC);
pool->sent++;
pool->throttle += (1 << pool->minpoll) - 2;
-#ifdef DEBUG
- if (debug)
- printf("transmit: at %ld %s->%s pool\n",
- current_time, latoa(lcladr), stoa(rmtadr));
-#endif
+ DPRINTF(1, ("pool_xmit: at %ld %s->%s pool\n",
+ current_time, latoa(lcladr), stoa(rmtadr)));
msyslog(LOG_INFO, "Soliciting pool server %s", stoa(rmtadr));
#endif /* WORKER */
}
@@ -3849,7 +3866,8 @@ pool_xmit(
* group different 1 ignore
* * ignore if notrust
*/
-int group_test(
+int
+group_test(
char *grp,
char *ident
)
@@ -3929,11 +3947,8 @@ key_expire(
value_free(&peer->sndval);
peer->keynumber = 0;
peer->flags &= ~FLAG_ASSOC;
-#ifdef DEBUG
- if (debug)
- printf("key_expire: at %lu associd %d\n", current_time,
- peer->associd);
-#endif
+ DPRINTF(1, ("key_expire: at %lu associd %d\n", current_time,
+ peer->associd));
}
#endif /* AUTOKEY */
diff --git a/contrib/ntp/ntpd/ntp_refclock.c b/contrib/ntp/ntpd/ntp_refclock.c
index 1f16ca7..d25cc2c 100644
--- a/contrib/ntp/ntpd/ntp_refclock.c
+++ b/contrib/ntp/ntpd/ntp_refclock.c
@@ -732,9 +732,9 @@ process_refclock_packet(
*/
int
refclock_open(
- char *dev, /* device name pointer */
- u_int speed, /* serial port speed (code) */
- u_int lflags /* line discipline flags */
+ const char *dev, /* device name pointer */
+ u_int speed, /* serial port speed (code) */
+ u_int lflags /* line discipline flags */
)
{
int fd;
diff --git a/contrib/ntp/ntpd/ntp_request.c b/contrib/ntp/ntpd/ntp_request.c
index 6073f99..fa78ce1 100644
--- a/contrib/ntp/ntpd/ntp_request.c
+++ b/contrib/ntp/ntpd/ntp_request.c
@@ -2006,11 +2006,11 @@ do_trustkey(
u_long trust
)
{
- register u_long *kp;
+ register uint32_t *kp;
register int items;
items = INFO_NITEMS(inpkt->err_nitems);
- kp = (u_long *)&inpkt->u;
+ kp = (uint32_t*)&inpkt->u;
while (items-- > 0) {
authtrust(*kp, trust);
kp++;
diff --git a/contrib/ntp/ntpd/ntp_restrict.c b/contrib/ntp/ntpd/ntp_restrict.c
index 82bbaef..0b5fa2e 100644
--- a/contrib/ntp/ntpd/ntp_restrict.c
+++ b/contrib/ntp/ntpd/ntp_restrict.c
@@ -160,7 +160,7 @@ alloc_res4(void)
const size_t count = INC_RESLIST4;
restrict_u * rl;
restrict_u * res;
- int i;
+ size_t i;
UNLINK_HEAD_SLIST(res, resfree4, link);
if (res != NULL)
@@ -186,7 +186,7 @@ alloc_res6(void)
const size_t count = INC_RESLIST6;
restrict_u * rl;
restrict_u * res;
- int i;
+ size_t i;
UNLINK_HEAD_SLIST(res, resfree6, link);
if (res != NULL)
diff --git a/contrib/ntp/ntpd/ntp_signd.c b/contrib/ntp/ntpd/ntp_signd.c
index 2ba11d0..857dcbf 100644
--- a/contrib/ntp/ntpd/ntp_signd.c
+++ b/contrib/ntp/ntpd/ntp_signd.c
@@ -66,7 +66,7 @@ write_all(int fd, const void *buf, size_t len)
while (len) {
int n = write(fd, buf, len);
if (n <= 0) return total;
- buf = n + (char *)buf;
+ buf = n + (const char *)buf;
len -= n;
total += n;
}
@@ -110,9 +110,10 @@ recv_packet(int fd, char **buf, uint32_t *len)
{
if (read_all(fd, len, sizeof(*len)) != sizeof(*len)) return -1;
*len = ntohl(*len);
- (*buf) = emalloc(*len);
+ *buf = emalloc(*len);
if (read_all(fd, *buf, *len) != *len) {
free(*buf);
+ *buf = NULL;
return -1;
}
return 0;
diff --git a/contrib/ntp/ntpd/ntp_timer.c b/contrib/ntp/ntpd/ntp_timer.c
index 828aa8c..03084a3 100644
--- a/contrib/ntp/ntpd/ntp_timer.c
+++ b/contrib/ntp/ntpd/ntp_timer.c
@@ -626,18 +626,19 @@ check_leapsec(
* announce the leap event has happened.
*/
const char *leapmsg = NULL;
- if (lsdata.warped < 0) {
+ double lswarp = lsdata.warped;
+ if (lswarp < 0.0) {
if (clock_max_back > 0.0 &&
- clock_max_back < fabs(lsdata.warped)) {
- step_systime(lsdata.warped);
+ clock_max_back < -lswarp) {
+ step_systime(lswarp);
leapmsg = leapmsg_p_step;
} else {
leapmsg = leapmsg_p_slew;
}
- } else if (lsdata.warped > 0) {
+ } else if (lswarp > 0.0) {
if (clock_max_fwd > 0.0 &&
- clock_max_fwd < fabs(lsdata.warped)) {
- step_systime(lsdata.warped);
+ clock_max_fwd < lswarp) {
+ step_systime(lswarp);
leapmsg = leapmsg_n_step;
} else {
leapmsg = leapmsg_n_slew;
diff --git a/contrib/ntp/ntpd/ntp_util.c b/contrib/ntp/ntpd/ntp_util.c
index c4bc901..3a95819 100644
--- a/contrib/ntp/ntpd/ntp_util.c
+++ b/contrib/ntp/ntpd/ntp_util.c
@@ -334,7 +334,7 @@ stats_config(
{
FILE *fp;
const char *value;
- int len;
+ size_t len;
double old_drift;
l_fp now;
time_t ttnow;
@@ -437,7 +437,7 @@ stats_config(
(int)sizeof(statsdir) - 2);
} else {
int add_dir_sep;
- int value_l;
+ size_t value_l;
/* Add a DIR_SEP unless we already have one. */
value_l = strlen(value);
@@ -933,7 +933,7 @@ getauthkeys(
const char *keyfile
)
{
- int len;
+ size_t len;
len = strlen(keyfile);
if (!len)
diff --git a/contrib/ntp/ntpd/ntpd-opts.c b/contrib/ntp/ntpd/ntpd-opts.c
index 1bbecfa..660884b 100644
--- a/contrib/ntp/ntpd/ntpd-opts.c
+++ b/contrib/ntp/ntpd/ntpd-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
- * It has been AutoGen-ed October 21, 2015 at 12:36:00 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 7, 2016 at 11:28:29 PM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
@@ -75,7 +75,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpd options
*/
static char const ntpd_opt_strs[3129] =
-/* 0 */ "ntpd 4.2.8p4\n"
+/* 0 */ "ntpd 4.2.8p5\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -205,12 +205,12 @@ static char const ntpd_opt_strs[3129] =
/* 2900 */ "output version information and exit\0"
/* 2936 */ "version\0"
/* 2944 */ "NTPD\0"
-/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p4\n"
+/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p5\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ <server1> ... <serverN> ]\n\0"
/* 3080 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 3114 */ "\n\0"
-/* 3116 */ "ntpd 4.2.8p4";
+/* 3116 */ "ntpd 4.2.8p5";
/**
* ipv4 option description with
@@ -1529,7 +1529,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdOptions.pzCopyright */
- puts(_("ntpd 4.2.8p4\n\
+ puts(_("ntpd 4.2.8p5\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1670,7 +1670,7 @@ implied warranty.\n"));
puts(_("output version information and exit"));
/* referenced via ntpdOptions.pzUsageTitle */
- puts(_("ntpd - NTP daemon program - Ver. 4.2.8p4\n\
+ puts(_("ntpd - NTP daemon program - Ver. 4.2.8p5\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ <server1> ... <serverN> ]\n"));
@@ -1678,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via ntpdOptions.pzFullVersion */
- puts(_("ntpd 4.2.8p4"));
+ puts(_("ntpd 4.2.8p5"));
/* referenced via ntpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpd/ntpd-opts.h b/contrib/ntp/ntpd/ntpd-opts.h
index d87c221..571fd34 100644
--- a/contrib/ntp/ntpd/ntpd-opts.h
+++ b/contrib/ntp/ntpd/ntpd-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
- * It has been AutoGen-ed October 21, 2015 at 12:35:59 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed January 7, 2016 at 11:28:28 PM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
@@ -106,9 +106,9 @@ typedef enum {
/** count of all options for ntpd */
#define OPTION_CT 38
/** ntpd version */
-#define NTPD_VERSION "4.2.8p4"
+#define NTPD_VERSION "4.2.8p5"
/** Full ntpd version text */
-#define NTPD_FULL_VERSION "ntpd 4.2.8p4"
+#define NTPD_FULL_VERSION "ntpd 4.2.8p5"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpd/ntpd.1ntpdman b/contrib/ntp/ntpd/ntpd.1ntpdman
index 187a79a..42d0caf 100644
--- a/contrib/ntp/ntpd/ntpd.1ntpdman
+++ b/contrib/ntp/ntpd/ntpd.1ntpdman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd 1ntpdman "21 Oct 2015" "4.2.8p4" "User Commands"
+.TH ntpd 1ntpdman "07 Jan 2016" "4.2.8p5" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dUaOfK/ag-qUaGeK)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-KDaWJq/ag-WDaOIq)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:11 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:44 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpd/ntpd.1ntpdmdoc b/contrib/ntp/ntpd/ntpd.1ntpdmdoc
index 139de52..dc06f58 100644
--- a/contrib/ntp/ntpd/ntpd.1ntpdmdoc
+++ b/contrib/ntp/ntpd/ntpd.1ntpdmdoc
@@ -1,9 +1,9 @@
-.Dd October 21 2015
+.Dd January 7 2016
.Dt NTPD 1ntpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:30 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:31:02 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
index a517391..7630aee 100644
--- a/contrib/ntp/ntpd/ntpd.c
+++ b/contrib/ntp/ntpd/ntpd.c
@@ -27,12 +27,16 @@
#include "ntp_libopts.h"
#include "ntpd-opts.h"
-/* there's a short treatise below what the thread stuff is for */
+/* there's a short treatise below what the thread stuff is for.
+ * [Bug 2954] enable the threading warm-up only for Linux.
+ */
#if defined(HAVE_PTHREADS) && HAVE_PTHREADS && !defined(NO_THREADS)
# ifdef HAVE_PTHREAD_H
# include <pthread.h>
# endif
-# define NEED_PTHREAD_WARMUP
+# if defined(linux)
+# define NEED_PTHREAD_WARMUP
+# endif
#endif
#ifdef HAVE_UNISTD_H
@@ -269,6 +273,9 @@ static void library_unexpected_error(const char *, int,
* This uses only the standard pthread API and should work with all
* implementations of pthreads. It is not necessary everywhere, but it's
* cheap enough to go on nearly unnoticed.
+ *
+ * Addendum: Bug 2954 showed that the assumption that this should work
+ * with all OS is wrong -- at least FreeBSD bombs heavily.
*/
#ifdef NEED_PTHREAD_WARMUP
@@ -646,6 +653,9 @@ ntpdmain(
# endif
# ifdef HAVE_WORKING_FORK
+ /* make sure the FDs are initialised */
+ pipe_fds[0] = -1;
+ pipe_fds[1] = -1;
do { /* 'loop' once */
if (!HAVE_OPT( WAIT_SYNC ))
break;
diff --git a/contrib/ntp/ntpd/ntpd.html b/contrib/ntp/ntpd/ntpd.html
index 8d6f9d6..ae3e17c 100644
--- a/contrib/ntp/ntpd/ntpd.html
+++ b/contrib/ntp/ntpd/ntpd.html
@@ -39,7 +39,7 @@ The program can operate in any of several modes, including client/server,
symmetric and broadcast modes, and with both symmetric-key and public-key
cryptography.
- <p>This document applies to version 4.2.8p4 of <code>ntpd</code>.
+ <p>This document applies to version 4.2.8p5 of <code>ntpd</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
@@ -220,7 +220,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p4-sec-RC2
+<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p4
Usage: ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ &lt;server1&gt; ... &lt;serverN&gt; ]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/ntpd/ntpd.man.in b/contrib/ntp/ntpd/ntpd.man.in
index 21bd884..222f0b3 100644
--- a/contrib/ntp/ntpd/ntpd.man.in
+++ b/contrib/ntp/ntpd/ntpd.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd @NTPD_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
+.TH ntpd @NTPD_MS@ "07 Jan 2016" "4.2.8p5" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dUaOfK/ag-qUaGeK)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-KDaWJq/ag-WDaOIq)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:11 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:30:44 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpd/ntpd.mdoc.in b/contrib/ntp/ntpd/ntpd.mdoc.in
index ad71af9..e5be1ee 100644
--- a/contrib/ntp/ntpd/ntpd.mdoc.in
+++ b/contrib/ntp/ntpd/ntpd.mdoc.in
@@ -1,9 +1,9 @@
-.Dd October 21 2015
+.Dd January 7 2016
.Dt NTPD @NTPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed October 21, 2015 at 12:38:30 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed January 7, 2016 at 11:31:02 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/refclock_local.c b/contrib/ntp/ntpd/refclock_local.c
index d816c55..8c0f74f 100644
--- a/contrib/ntp/ntpd/refclock_local.c
+++ b/contrib/ntp/ntpd/refclock_local.c
@@ -205,6 +205,7 @@ local_poll(
pp->disp = 0;
pp->jitter = 0;
#else /* KERNEL_PLL LOCKCLOCK */
+ pp->leap = LEAP_NOWARNING;
pp->disp = DISPERSION;
pp->jitter = 0;
#endif /* KERNEL_PLL LOCKCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_parse.c b/contrib/ntp/ntpd/refclock_parse.c
index 8e90595..eb69dcb 100644
--- a/contrib/ntp/ntpd/refclock_parse.c
+++ b/contrib/ntp/ntpd/refclock_parse.c
@@ -1630,9 +1630,9 @@ list_err(
static char *
mkreadable(
char *buffer,
- long blen,
+ size_t blen,
const char *src,
- u_long srclen,
+ size_t srclen,
int hex
)
{
diff --git a/contrib/ntp/ntpd/refclock_shm.c b/contrib/ntp/ntpd/refclock_shm.c
index 6ab5d02..f3e7f51 100644
--- a/contrib/ntp/ntpd/refclock_shm.c
+++ b/contrib/ntp/ntpd/refclock_shm.c
@@ -381,7 +381,8 @@ static inline void memory_barrier(void)
static enum segstat_t shm_query(volatile struct shmTime *shm_in, struct shm_stat_t *shm_stat)
/* try to grab a sample from the specified SHM segment */
{
- volatile struct shmTime shmcopy, *shm = shm_in;
+ struct shmTime shmcopy;
+ volatile struct shmTime *shm = shm_in;
volatile int cnt;
unsigned int cns_new, rns_new;
@@ -418,7 +419,7 @@ static enum segstat_t shm_query(volatile struct shmTime *shm_in, struct shm_stat
* (b) memset compiles to an uninterruptible single-instruction bitblt.
*/
memory_barrier();
- memcpy((void *)&shmcopy, (void *)shm, sizeof(struct shmTime));
+ memcpy(&shmcopy, (void*)(uintptr_t)shm, sizeof(struct shmTime));
shm->valid = 0;
memory_barrier();
diff --git a/contrib/ntp/ntpd/refclock_true.c b/contrib/ntp/ntpd/refclock_true.c
index 67ba6df..2799f3e 100644
--- a/contrib/ntp/ntpd/refclock_true.c
+++ b/contrib/ntp/ntpd/refclock_true.c
@@ -637,7 +637,7 @@ true_send(
pp = peer->procptr;
if (!(pp->sloppyclockflag & CLK_FLAG1)) {
- int len = strlen(cmd);
+ size_t len = strlen(cmd);
true_debug(peer, "Send '%s'\n", cmd);
if (write(pp->io.fd, cmd, (unsigned)len) != len)
diff --git a/contrib/ntp/ntpd/refclock_tsyncpci.c b/contrib/ntp/ntpd/refclock_tsyncpci.c
index e70a7cf..e14a3fd 100644
--- a/contrib/ntp/ntpd/refclock_tsyncpci.c
+++ b/contrib/ntp/ntpd/refclock_tsyncpci.c
@@ -549,7 +549,7 @@ static void tsync_poll(int unit, struct peer *peer)
memcpy(ppsRef, pRefObj->pps, TSYNC_REF_LEN);
// Extract the Clock Service Time Scale and convert to correct byte order
- memcpy(&tmscl, ((TIME_SCALE*)(it1->payloads)), sizeof(tmscl));
+ memcpy(&tmscl, it1->payloads, sizeof(tmscl));
tmscl = ntohl(tmscl);
// Extract leap second info from ioctl payload and perform byte swapping
OpenPOWER on IntegriCloud