aboutsummaryrefslogtreecommitdiff
path: root/ntpd
diff options
context:
space:
mode:
Diffstat (limited to 'ntpd')
-rw-r--r--ntpd/complete.conf.in2
-rw-r--r--ntpd/invoke-ntp.conf.texi12
-rw-r--r--ntpd/invoke-ntp.keys.texi6
-rw-r--r--ntpd/invoke-ntpd.texi4
-rw-r--r--ntpd/ntp.conf.5man16
-rw-r--r--ntpd/ntp.conf.5mdoc14
-rw-r--r--ntpd/ntp.conf.def10
-rw-r--r--ntpd/ntp.conf.html12
-rw-r--r--ntpd/ntp.conf.man.in16
-rw-r--r--ntpd/ntp.conf.mdoc.in14
-rw-r--r--ntpd/ntp.keys.5man8
-rw-r--r--ntpd/ntp.keys.5mdoc8
-rw-r--r--ntpd/ntp.keys.def4
-rw-r--r--ntpd/ntp.keys.html6
-rw-r--r--ntpd/ntp.keys.man.in8
-rw-r--r--ntpd/ntp.keys.mdoc.in8
-rw-r--r--ntpd/ntp_config.c39
-rw-r--r--ntpd/ntp_control.c97
-rw-r--r--ntpd/ntp_io.c55
-rw-r--r--ntpd/ntp_loopfilter.c12
-rw-r--r--ntpd/ntp_parser.c677
-rw-r--r--ntpd/ntp_parser.h2
-rw-r--r--ntpd/ntp_parser.y1
-rw-r--r--ntpd/ntp_proto.c145
-rw-r--r--ntpd/ntp_refclock.c2
-rw-r--r--ntpd/ntp_request.c1
-rw-r--r--ntpd/ntpd-opts.c14
-rw-r--r--ntpd/ntpd-opts.h6
-rw-r--r--ntpd/ntpd.1ntpdman6
-rw-r--r--ntpd/ntpd.1ntpdmdoc4
-rw-r--r--ntpd/ntpd.c398
-rw-r--r--ntpd/ntpd.html4
-rw-r--r--ntpd/ntpd.man.in6
-rw-r--r--ntpd/ntpd.mdoc.in4
-rw-r--r--ntpd/rc_cmdlength.c2
-rw-r--r--ntpd/refclock_datum.c3
-rw-r--r--ntpd/refclock_gpsdjson.c4
-rw-r--r--ntpd/refclock_jupiter.c3
-rw-r--r--ntpd/refclock_shm.c1
-rw-r--r--ntpd/refclock_true.c2
40 files changed, 918 insertions, 718 deletions
diff --git a/ntpd/complete.conf.in b/ntpd/complete.conf.in
index 2747098d7fcc..66fcbaa478de 100644
--- a/ntpd/complete.conf.in
+++ b/ntpd/complete.conf.in
@@ -21,7 +21,7 @@ crypto digest md5 host myhostname ident wedent pw cryptopass randfile /.rnd
revoke 10
keysdir "/etc/ntp/keys"
keys "/etc/ntp.keys"
-trustedkey 1 2 3 4 5 6 7 8 9 10 11 12 (14 ... 16) 18 (32768 ... 65534)
+trustedkey 1 2 3 4 5 6 7 8 9 10 11 12 (14 ... 16) 18 (32768 ... 65535)
controlkey 12
requestkey 12
enable auth ntp monitor stats
diff --git a/ntpd/invoke-ntp.conf.texi b/ntpd/invoke-ntp.conf.texi
index 7e8a4dc54031..7e675877e8e2 100644
--- a/ntpd/invoke-ntp.conf.texi
+++ b/ntpd/invoke-ntp.conf.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
-# It has been AutoGen-ed February 27, 2018 at 05:14:34 PM by AutoGen 5.18.5
+# It has been AutoGen-ed August 14, 2018 at 08:29:07 AM by AutoGen 5.18.5
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
@@ -284,7 +284,7 @@ option.
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
@kbd{key}
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
@item @code{minpoll} @kbd{minpoll}
@@ -543,7 +543,7 @@ and reports at the NTP project page linked from
@code{http://www.ntp.org/}.
@subsubsection Symmetric-Key Cryptography
The original RFC-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32-bit key identifier, to
+65,535 keys, each distinguished by a 32-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -827,7 +827,7 @@ The
@kbd{key}
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
@item @code{crypto} @code{[@code{cert} @kbd{file}]} @code{[@code{leap} @kbd{file}]} @code{[@code{randfile} @kbd{file}]} @code{[@code{host} @kbd{file}]} @code{[@code{sign} @kbd{file}]} @code{[@code{gq} @kbd{file}]} @code{[@code{gqpar} @kbd{file}]} @code{[@code{iffpar} @kbd{file}]} @code{[@code{mvpar} @kbd{file}]} @code{[@code{pw} @kbd{password}]}
This command requires the OpenSSL library.
It activates public key
@@ -920,7 +920,7 @@ The
@kbd{key}
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
@item @code{revoke} @kbd{logsec}
Specifies the interval between re-randomization of certain
cryptographic values used by the Autokey scheme, as a power of 2 in
@@ -947,7 +947,7 @@ servers.
The
@kbd{key}
arguments are 32-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
@end table
@subsubsection Error Codes
The following error codes are reported via the NTP control
diff --git a/ntpd/invoke-ntp.keys.texi b/ntpd/invoke-ntp.keys.texi
index d729fc075a28..a1f1e9520517 100644
--- a/ntpd/invoke-ntp.keys.texi
+++ b/ntpd/invoke-ntp.keys.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
-# It has been AutoGen-ed February 27, 2018 at 05:14:37 PM by AutoGen 5.18.5
+# It has been AutoGen-ed August 14, 2018 at 08:29:10 AM by AutoGen 5.18.5
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore
@@ -29,7 +29,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
The key file uses the same comment conventions
@@ -42,7 +42,7 @@ Key entries use a fixed format of the form
where
@kbd{keyno}
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
@kbd{type}
is the message digest algorithm,
@kbd{key}
diff --git a/ntpd/invoke-ntpd.texi b/ntpd/invoke-ntpd.texi
index 28f132df4d5a..b50529401e55 100644
--- a/ntpd/invoke-ntpd.texi
+++ b/ntpd/invoke-ntpd.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
-# It has been AutoGen-ed February 27, 2018 at 05:14:39 PM by AutoGen 5.18.5
+# It has been AutoGen-ed August 14, 2018 at 08:29:12 AM 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.8p11
+ntpd - NTP daemon program - Ver. 4.2.8p12
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
diff --git a/ntpd/ntp.conf.5man b/ntpd/ntp.conf.5man
index 1a506336a71d..e1f061cfeb0a 100644
--- a/ntpd/ntp.conf.5man
+++ b/ntpd/ntp.conf.5man
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5man "27 Feb 2018" "4.2.8p11" "File Formats"
+.TH ntp.conf 5man "14 Aug 2018" "4.2.8p12" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-LkaqTP/ag-XkaiSP)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-2caiQA/ag-bdaaPA)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:22 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:28:54 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -326,7 +326,7 @@ option.
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
\f\*[I-Font]key\f[]
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
.TP 7
@@ -611,7 +611,7 @@ and reports at the NTP project page linked from
\f[C]http://www.ntp.org/\f[].
.SS Symmetric-Key Cryptography
The original RFC-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32-bit key identifier, to
+65,535 keys, each distinguished by a 32-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -932,7 +932,7 @@ The
\f\*[I-Font]key\f[]
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
.TP 7
.NOP \f\*[B-Font]crypto\f[] [\f\*[B-Font]cert\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]leap\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]randfile\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]host\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]sign\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gq\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gqpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]iffpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]mvpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]]
This command requires the OpenSSL library.
@@ -1038,7 +1038,7 @@ The
\f\*[I-Font]key\f[]
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
.TP 7
.NOP \f\*[B-Font]revoke\f[] \f\*[I-Font]logsec\f[]
Specifies the interval between re-randomization of certain
@@ -1067,7 +1067,7 @@ servers.
The
\f\*[I-Font]key\f[]
arguments are 32-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
.PP
.SS Error Codes
The following error codes are reported via the NTP control
diff --git a/ntpd/ntp.conf.5mdoc b/ntpd/ntp.conf.5mdoc
index 7286c811c2ce..d31c6b761132 100644
--- a/ntpd/ntp.conf.5mdoc
+++ b/ntpd/ntp.conf.5mdoc
@@ -1,9 +1,9 @@
-.Dd February 27 2018
+.Dd August 14 2018
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:42 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:15 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -325,7 +325,7 @@ option.
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
.Ar key
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
.It Cm minpoll Ar minpoll
@@ -583,7 +583,7 @@ and reports at the NTP project page linked from
.Li http://www.ntp.org/ .
.Ss Symmetric\-Key Cryptography
The original RFC\-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32\-bit key identifier, to
+65,535 keys, each distinguished by a 32\-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -877,7 +877,7 @@ The
.Ar key
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
.It Xo Ic crypto
.Op Cm cert Ar file
.Op Cm leap Ar file
@@ -981,7 +981,7 @@ The
.Ar key
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
.It Ic revoke Ar logsec
Specifies the interval between re\-randomization of certain
cryptographic values used by the Autokey scheme, as a power of 2 in
@@ -1008,7 +1008,7 @@ servers.
The
.Ar key
arguments are 32\-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
.El
.Ss Error Codes
The following error codes are reported via the NTP control
diff --git a/ntpd/ntp.conf.def b/ntpd/ntp.conf.def
index 4af7742168ef..9684fb12065c 100644
--- a/ntpd/ntp.conf.def
+++ b/ntpd/ntp.conf.def
@@ -327,7 +327,7 @@ option.
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
.Ar key
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
.It Cm minpoll Ar minpoll
@@ -585,7 +585,7 @@ and reports at the NTP project page linked from
.Li http://www.ntp.org/ .
.Ss Symmetric-Key Cryptography
The original RFC-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32-bit key identifier, to
+65,535 keys, each distinguished by a 32-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -879,7 +879,7 @@ The
.Ar key
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
.It Xo Ic crypto
.Op Cm cert Ar file
.Op Cm leap Ar file
@@ -983,7 +983,7 @@ The
.Ar key
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
.It Ic revoke Ar logsec
Specifies the interval between re-randomization of certain
cryptographic values used by the Autokey scheme, as a power of 2 in
@@ -1010,7 +1010,7 @@ servers.
The
.Ar key
arguments are 32-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
.El
.Ss Error Codes
The following error codes are reported via the NTP control
diff --git a/ntpd/ntp.conf.html b/ntpd/ntp.conf.html
index 2d477e2f33d5..5439ff7a7f37 100644
--- a/ntpd/ntp.conf.html
+++ b/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.8p11 of <code>ntp.conf</code>.
+ <p>This document applies to version 4.2.8p12 of <code>ntp.conf</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -329,7 +329,7 @@ option.
<br><dt><code>key</code> <kbd>key</kbd><dd>All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
<kbd>key</kbd>
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
<br><dt><code>minpoll</code> <kbd>minpoll</kbd><br><dt><code>maxpoll</code> <kbd>maxpoll</kbd><dd>These options specify the minimum and maximum poll intervals
@@ -584,7 +584,7 @@ and reports at the NTP project page linked from
<h5 class="subsubsection">Symmetric-Key Cryptography</h5>
<p>The original RFC-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32-bit key identifier, to
+65,535 keys, each distinguished by a 32-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -876,7 +876,7 @@ The
<kbd>key</kbd>
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
<br><dt><code>crypto</code> <code>[cert </code><kbd>file</kbd><code>]</code> <code>[leap </code><kbd>file</kbd><code>]</code> <code>[randfile </code><kbd>file</kbd><code>]</code> <code>[host </code><kbd>file</kbd><code>]</code> <code>[sign </code><kbd>file</kbd><code>]</code> <code>[gq </code><kbd>file</kbd><code>]</code> <code>[gqpar </code><kbd>file</kbd><code>]</code> <code>[iffpar </code><kbd>file</kbd><code>]</code> <code>[mvpar </code><kbd>file</kbd><code>]</code> <code>[pw </code><kbd>password</kbd><code>]</code><dd>This command requires the OpenSSL library.
It activates public key
cryptography, selects the message digest and signature
@@ -956,7 +956,7 @@ The
<kbd>key</kbd>
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
<br><dt><code>revoke</code> <kbd>logsec</kbd><dd>Specifies the interval between re-randomization of certain
cryptographic values used by the Autokey scheme, as a power of 2 in
seconds.
@@ -981,7 +981,7 @@ servers.
The
<kbd>key</kbd>
arguments are 32-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
</dl>
<h5 class="subsubsection">Error Codes</h5>
diff --git a/ntpd/ntp.conf.man.in b/ntpd/ntp.conf.man.in
index 0f2b21191f96..8f6c99c98503 100644
--- a/ntpd/ntp.conf.man.in
+++ b/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 "27 Feb 2018" "4.2.8p11" "File Formats"
+.TH ntp.conf 5 "14 Aug 2018" "4.2.8p12" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-LkaqTP/ag-XkaiSP)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-2caiQA/ag-bdaaPA)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:22 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:28:54 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -326,7 +326,7 @@ option.
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
\f\*[I-Font]key\f[]
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
.TP 7
@@ -611,7 +611,7 @@ and reports at the NTP project page linked from
\f[C]http://www.ntp.org/\f[].
.SS Symmetric-Key Cryptography
The original RFC-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32-bit key identifier, to
+65,535 keys, each distinguished by a 32-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -932,7 +932,7 @@ The
\f\*[I-Font]key\f[]
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
.TP 7
.NOP \f\*[B-Font]crypto\f[] [\f\*[B-Font]cert\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]leap\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]randfile\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]host\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]sign\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gq\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]gqpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]iffpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]mvpar\f[] \f\*[I-Font]file\f[]] [\f\*[B-Font]pw\f[] \f\*[I-Font]password\f[]]
This command requires the OpenSSL library.
@@ -1038,7 +1038,7 @@ The
\f\*[I-Font]key\f[]
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
.TP 7
.NOP \f\*[B-Font]revoke\f[] \f\*[I-Font]logsec\f[]
Specifies the interval between re-randomization of certain
@@ -1067,7 +1067,7 @@ servers.
The
\f\*[I-Font]key\f[]
arguments are 32-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
.PP
.SS Error Codes
The following error codes are reported via the NTP control
diff --git a/ntpd/ntp.conf.mdoc.in b/ntpd/ntp.conf.mdoc.in
index 321acc99da05..3fa7f8d34707 100644
--- a/ntpd/ntp.conf.mdoc.in
+++ b/ntpd/ntp.conf.mdoc.in
@@ -1,9 +1,9 @@
-.Dd February 27 2018
+.Dd August 14 2018
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:42 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:15 AM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -325,7 +325,7 @@ option.
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified
.Ar key
-identifier with values from 1 to 65534, inclusive.
+identifier with values from 1 to 65535, inclusive.
The
default is to include no encryption field.
.It Cm minpoll Ar minpoll
@@ -583,7 +583,7 @@ and reports at the NTP project page linked from
.Li http://www.ntp.org/ .
.Ss Symmetric\-Key Cryptography
The original RFC\-1305 specification allows any one of possibly
-65,534 keys, each distinguished by a 32\-bit key identifier, to
+65,535 keys, each distinguished by a 32\-bit key identifier, to
authenticate an association.
The servers and clients involved must
agree on the key and key identifier to
@@ -877,7 +877,7 @@ The
.Ar key
argument is
the key identifier for a trusted key, where the value can be in the
-range 1 to 65,534, inclusive.
+range 1 to 65,535, inclusive.
.It Xo Ic crypto
.Op Cm cert Ar file
.Op Cm leap Ar file
@@ -981,7 +981,7 @@ The
.Ar key
argument is a key identifier
for the trusted key, where the value can be in the range 1 to
-65,534, inclusive.
+65,535, inclusive.
.It Ic revoke Ar logsec
Specifies the interval between re\-randomization of certain
cryptographic values used by the Autokey scheme, as a power of 2 in
@@ -1008,7 +1008,7 @@ servers.
The
.Ar key
arguments are 32\-bit unsigned
-integers with values from 1 to 65,534.
+integers with values from 1 to 65,535.
.El
.Ss Error Codes
The following error codes are reported via the NTP control
diff --git a/ntpd/ntp.keys.5man b/ntpd/ntp.keys.5man
index b107e02ea2a0..e52d94d3e423 100644
--- a/ntpd/ntp.keys.5man
+++ b/ntpd/ntp.keys.5man
@@ -1,8 +1,8 @@
-.TH ntp.keys 5man "27 Feb 2018" "4.2.8p11" "File Formats"
+.TH ntp.keys 5man "14 Aug 2018" "4.2.8p12" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:26 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:28:59 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
@@ -54,7 +54,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
.sp \n(Ppu
.ne 2
@@ -73,7 +73,7 @@ Key entries use a fixed format of the form
where
\f\*[I-Font]keyno\f[]
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
\f\*[I-Font]type\f[]
is the message digest algorithm,
\f\*[I-Font]key\f[]
diff --git a/ntpd/ntp.keys.5mdoc b/ntpd/ntp.keys.5mdoc
index bec3980fc357..8f4190c813b2 100644
--- a/ntpd/ntp.keys.5mdoc
+++ b/ntpd/ntp.keys.5mdoc
@@ -1,9 +1,9 @@
-.Dd February 27 2018
+.Dd August 14 2018
.Dt NTP_KEYS 5mdoc File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:46 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:18 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -37,7 +37,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
.Pp
The key file uses the same comment conventions
@@ -48,7 +48,7 @@ Key entries use a fixed format of the form
.Pp
where
.Ar keyno
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
.Ar type
is the message digest algorithm,
.Ar key
diff --git a/ntpd/ntp.keys.def b/ntpd/ntp.keys.def
index 88dd2aac3e08..e73ce4d06a1b 100644
--- a/ntpd/ntp.keys.def
+++ b/ntpd/ntp.keys.def
@@ -36,7 +36,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
.Pp
The key file uses the same comment conventions
@@ -47,7 +47,7 @@ Key entries use a fixed format of the form
.Pp
where
.Ar keyno
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
.Ar type
is the message digest algorithm,
.Ar key
diff --git a/ntpd/ntp.keys.html b/ntpd/ntp.keys.html
index 28a4076aaa00..25fb763f1d32 100644
--- a/ntpd/ntp.keys.html
+++ b/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.8p11 of <code>ntp.keys</code>.
+ <p>This document applies to version 4.2.8p12 of <code>ntp.keys</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -86,7 +86,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
<p>The key file uses the same comment conventions
@@ -97,7 +97,7 @@ Key entries use a fixed format of the form
</pre>
<p>where
<kbd>keyno</kbd>
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
<kbd>type</kbd>
is the message digest algorithm,
<kbd>key</kbd>
diff --git a/ntpd/ntp.keys.man.in b/ntpd/ntp.keys.man.in
index 3712747d4475..fd85bb8f5700 100644
--- a/ntpd/ntp.keys.man.in
+++ b/ntpd/ntp.keys.man.in
@@ -1,8 +1,8 @@
-.TH ntp.keys 5 "27 Feb 2018" "4.2.8p11" "File Formats"
+.TH ntp.keys 5 "14 Aug 2018" "4.2.8p12" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:26 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:28:59 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
@@ -54,7 +54,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
.sp \n(Ppu
.ne 2
@@ -73,7 +73,7 @@ Key entries use a fixed format of the form
where
\f\*[I-Font]keyno\f[]
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
\f\*[I-Font]type\f[]
is the message digest algorithm,
\f\*[I-Font]key\f[]
diff --git a/ntpd/ntp.keys.mdoc.in b/ntpd/ntp.keys.mdoc.in
index 6dc4f88c4815..26bb78ecec06 100644
--- a/ntpd/ntp.keys.mdoc.in
+++ b/ntpd/ntp.keys.mdoc.in
@@ -1,9 +1,9 @@
-.Dd February 27 2018
+.Dd August 14 2018
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:46 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:18 AM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
@@ -37,7 +37,7 @@ statement in the configuration file.
While key number 0 is fixed by the NTP standard
(as 56 zero bits)
and may not be changed,
-one or more keys numbered between 1 and 65534
+one or more keys numbered between 1 and 65535
may be arbitrarily set in the keys file.
.Pp
The key file uses the same comment conventions
@@ -48,7 +48,7 @@ Key entries use a fixed format of the form
.Pp
where
.Ar keyno
-is a positive integer (between 1 and 65534),
+is a positive integer (between 1 and 65535),
.Ar type
is the message digest algorithm,
.Ar key
diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c
index 003b1534a9c4..89c920c1ecb6 100644
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -364,7 +364,7 @@ static u_int32 get_match(const char *, struct masks *);
static u_int32 get_logmask(const char *);
static int/*BOOL*/ is_refclk_addr(const address_node * addr);
-static void appendstr(char *, size_t, char *);
+static void appendstr(char *, size_t, const char *);
#ifndef SIM
@@ -382,14 +382,14 @@ static void fatal_error(const char *fmt, ...)
#endif
{
va_list va;
-
+
va_start(va, fmt);
mvsyslog(LOG_EMERG, fmt, va);
va_end(va);
_exit(1);
}
-
+
/* FUNCTIONS FOR INITIALIZATION
* ----------------------------
*/
@@ -742,7 +742,7 @@ dump_config_tree(
atrv->value.i);
}
break;
-
+
case T_Double:
fprintf(df, " %s %s",
keyword(atrv->attr),
@@ -938,7 +938,7 @@ dump_config_tree(
if (T_Source == flag_tok_fifo->i) {
s = "source";
break;
- }
+ }
}
} else {
const char *ap = rest_node->addr->address;
@@ -1446,7 +1446,7 @@ create_unpeer_node(
/* accumulate with overflow retention */
u = (10 * u + *pch - '0') | (u & 0xFF000000u);
}
-
+
if (!*pch && u <= ASSOCID_MAX) {
my_node->assocID = (associd_t)u;
my_node->addr = NULL;
@@ -2132,7 +2132,7 @@ config_tos(
* since three variables with interdependecies are involved. We
* just log an error but do not stop: This might be caused by
* remote config, and it might be fixed by remote config, too.
- */
+ */
int l_maxclock = sys_maxclock;
int l_minclock = sys_minclock;
int l_minsane = sys_minsane;
@@ -2162,7 +2162,7 @@ config_tos(
tos->value.d = 0;
}
break;
-
+
case T_Ceiling:
val = tos->value.d;
if (val > STRATUM_UNSPEC - 1) {
@@ -2207,7 +2207,7 @@ config_tos(
" - daemon will not operate properly!",
l_minsane, l_minclock, l_maxclock);
}
-
+
/* -*- phase two: forward the values to the protocol machinery */
tos = HEAD_PFIFO(ptree->orphan_cmds);
for (; tos != NULL; tos = tos->link) {
@@ -3383,6 +3383,10 @@ config_ttl(
size_t i = 0;
int_node *curr_ttl;
+ /* [Bug 3465] There is a built-in default for the TTLs. We must
+ * overwrite 'sys_ttlmax' if we change that preset, and leave it
+ * alone otherwise!
+ */
curr_ttl = HEAD_PFIFO(ptree->ttl);
for (; curr_ttl != NULL; curr_ttl = curr_ttl->link) {
if (i < COUNTOF(sys_ttl))
@@ -3392,7 +3396,8 @@ config_ttl(
"ttl: Number of TTL entries exceeds %zu. Ignoring TTL %d...",
COUNTOF(sys_ttl), curr_ttl->i);
}
- sys_ttlmax = (i) ? (i - 1) : 0;
+ if (0 != i) /* anything written back at all? */
+ sys_ttlmax = i - 1;
}
#endif /* !SIM */
@@ -3621,10 +3626,8 @@ config_fudge(
err_flag = 1;
msyslog(LOG_ERR,
"unrecognized fudge reference clock address %s, line ignored",
- stoa(&addr_sock));
- }
-
- if (!ISREFCLOCKADR(&addr_sock)) {
+ addr_node->address);
+ } else if (!ISREFCLOCKADR(&addr_sock)) {
err_flag = 1;
msyslog(LOG_ERR,
"inappropriate address %s for the fudge command, line ignored",
@@ -3696,7 +3699,7 @@ config_fudge(
msyslog(LOG_ERR,
"Unexpected fudge flag %s (%d) for %s",
token_name(curr_opt->attr),
- curr_opt->attr, stoa(&addr_sock));
+ curr_opt->attr, addr_node->address);
exit(curr_opt->attr ? curr_opt->attr : 1);
}
}
@@ -4565,7 +4568,7 @@ config_ntpd(
if (config_tos_clock(ptree))
clamp_systime();
}
-
+
config_nic_rules(ptree, input_from_files);
config_monitor(ptree);
config_auth(ptree);
@@ -4845,7 +4848,7 @@ is_refclk_addr(
const address_node * addr
)
{
- return addr && addr->address && !strncmp(addr->address, "127.127.", 6);
+ return addr && addr->address && !strncmp(addr->address, "127.127.", 8);
}
static void
@@ -5463,7 +5466,7 @@ static void
appendstr(
char *string,
size_t s,
- char *new
+ const char *new
)
{
if (*string != '\0') {
diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c
index d98f6aa50886..48cd908f9a84 100644
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -916,7 +916,7 @@ is_safe_filename(const char * name)
u_int widx, bidx, mask;
if ( ! (name && *name))
return FALSE;
-
+
mask = 1u;
while (0 != (widx = (u_char)*name++)) {
bidx = (widx & 15) << 1;
@@ -955,7 +955,7 @@ save_config(
* level. On POSIX systems we could allow '\\' but such
* filenames are tricky to manipulate from a shell, so just
* reject both types of slashes on all platforms.
- */
+ */
/* TALOS-CAN-0062: block directory traversal for VMS, too */
static const char * illegal_in_filename =
#if defined(VMS)
@@ -983,8 +983,8 @@ save_config(
# if defined(_O_TEXT) /* windows, again */
| _O_TEXT
#endif
- ;
-
+ ;
+
char filespec[128];
char filename[128];
char fullpath[512];
@@ -1046,7 +1046,7 @@ save_config(
/* copy data directly as we exactly know the size */
memcpy(filespec, reqpt, reqlen);
filespec[reqlen] = '\0';
-
+
/*
* allow timestamping of the saved config filename with
* strftime() format such as:
@@ -1110,7 +1110,7 @@ save_config(
*/
prc = snprintf(fullpath, sizeof(fullpath), "%s%s",
saveconfigdir, filename);
- if (prc < 0 || prc >= sizeof(fullpath)) {
+ if (prc < 0 || (size_t)prc >= sizeof(fullpath)) {
ctl_printf("saveconfig exceeded maximum path length (%u)",
(u_int)sizeof(fullpath));
ctl_flushpkt(0);
@@ -1127,8 +1127,8 @@ save_config(
fptr = fdopen(fd, "w");
if (NULL == fptr || -1 == dump_all_config_trees(fptr, 1)) {
- ctl_printf("Unable to save configuration to file '%s': %m",
- filename);
+ ctl_printf("Unable to save configuration to file '%s': %s",
+ filename, strerror(errno));
msyslog(LOG_ERR,
"saveconfig %s from %s failed", filename,
stoa(&rbufp->recv_srcadr));
@@ -1154,7 +1154,7 @@ save_config(
#else /* !SAVECONFIG follows */
ctl_printf("%s",
"saveconfig unavailable, configured with --disable-saveconfig");
-#endif
+#endif
ctl_flushpkt(0);
}
@@ -1506,11 +1506,11 @@ ctl_putdata_ex(
} else {
datanotbinflag = TRUE;
add_len = 3;
-
+
if (datasent) {
*datapt++ = ',';
datalinelen++;
-
+
/* sum up total length */
for (argi = 0, src_len = 0; argi < argc; ++argi)
src_len += argv[argi].len;
@@ -1539,14 +1539,14 @@ ctl_putdata_ex(
/* Not enough room in this one, flush it out. */
if (src_len < cur_len)
cur_len = src_len;
-
+
memcpy(datapt, src_ptr, cur_len);
datapt += cur_len;
datalinelen += cur_len;
src_ptr += cur_len;
src_len -= cur_len;
-
+
ctl_flushpkt(CTL_MORE);
cur_len = (size_t)(dataend - datapt);
}
@@ -1571,7 +1571,7 @@ ctl_putdata(
)
{
CtlMemBufT args[1];
-
+
args[0].buf = dp;
args[0].len = dlen;
ctl_putdata_ex(args, 1, bin);
@@ -1594,7 +1594,7 @@ ctl_putstr(
)
{
CtlMemBufT args[4];
-
+
args[0].buf = tag;
args[0].len = strlen(tag);
if (data && len) {
@@ -1606,7 +1606,9 @@ ctl_putstr(
args[3].len = 1;
ctl_putdata_ex(args, 4, FALSE);
} else {
- ctl_putdata_ex(args, 1, FALSE);
+ args[1].buf = "=\"\"";
+ args[1].len = 3;
+ ctl_putdata_ex(args, 2, FALSE);
}
}
@@ -1628,17 +1630,17 @@ ctl_putunqstr(
)
{
CtlMemBufT args[3];
-
+
args[0].buf = tag;
args[0].len = strlen(tag);
+ args[1].buf = "=";
+ args[1].len = 1;
if (data && len) {
- args[1].buf = "=";
- args[1].len = 1;
- args[2].buf = data;
- args[2].len = len;
- ctl_putdata_ex(args, 3, FALSE);
+ args[2].buf = data;
+ args[2].len = len;
+ ctl_putdata_ex(args, 3, FALSE);
} else {
- ctl_putdata_ex(args, 1, FALSE);
+ ctl_putdata_ex(args, 2, FALSE);
}
}
@@ -1656,7 +1658,7 @@ ctl_putdblf(
{
char buffer[40];
int rc;
-
+
rc = snprintf(buffer, sizeof(buffer),
(use_f ? "%.*f" : "%.*g"),
precision, d);
@@ -1677,7 +1679,7 @@ ctl_putuint(
int rc;
rc = snprintf(buffer, sizeof(buffer), "%lu", uval);
- INSIST(rc >= 0 && rc < sizeof(buffer));
+ INSIST(rc >= 0 && (size_t)rc < sizeof(buffer));
ctl_putunqstr(tag, buffer, rc);
}
@@ -1716,7 +1718,7 @@ ctl_putfs(
{
char buffer[16];
int rc;
-
+
time_t fstamp = (time_t)uval - JAN_1970;
struct tm *tm = gmtime(&fstamp);
@@ -1744,7 +1746,7 @@ ctl_puthex(
{
char buffer[24]; /* must fit 64bit int! */
int rc;
-
+
rc = snprintf(buffer, sizeof(buffer), "0x%lx", uval);
INSIST(rc >= 0 && (size_t)rc < sizeof(buffer));
ctl_putunqstr(tag, buffer, rc);
@@ -1762,9 +1764,9 @@ ctl_putint(
{
char buffer[24]; /*must fit 64bit int */
int rc;
-
+
rc = snprintf(buffer, sizeof(buffer), "%ld", ival);
- INSIST(rc >= 0 && rc < sizeof(buffer));
+ INSIST(rc >= 0 && (size_t)rc < sizeof(buffer));
ctl_putunqstr(tag, buffer, rc);
}
@@ -1780,7 +1782,7 @@ ctl_putts(
{
char buffer[24];
int rc;
-
+
rc = snprintf(buffer, sizeof(buffer),
"0x%08lx.%08lx",
(u_long)ts->l_ui, (u_long)ts->l_uf);
@@ -1800,7 +1802,7 @@ ctl_putadr(
)
{
const char *cq;
-
+
if (NULL == addr)
cq = numtoa(addr32);
else
@@ -1827,7 +1829,9 @@ ctl_putrefid(
bytes.w = refid;
for (nc = 0; nc < sizeof(bytes.b) && bytes.b[nc]; ++nc)
- if (!isprint(bytes.b[nc]))
+ if ( !isprint(bytes.b[nc])
+ || isspace(bytes.b[nc])
+ || bytes.b[nc] == ',' )
bytes.b[nc] = '.';
ctl_putunqstr(tag, (const char*)bytes.b, nc);
}
@@ -1874,11 +1878,11 @@ ctl_printf(
va_list va;
char fmtbuf[128];
int rc;
-
+
va_start(va, fmt);
rc = vsnprintf(fmtbuf, sizeof(fmtbuf), fmt, va);
va_end(va);
- if (rc < 0 || rc >= sizeof(fmtbuf))
+ if (rc < 0 || (size_t)rc >= sizeof(fmtbuf))
strcpy(fmtbuf + sizeof(fmtbuf) - strlen(ellipsis) - 1,
ellipsis);
ctl_putdata(fmtbuf, strlen(fmtbuf), 0);
@@ -1951,10 +1955,10 @@ ctl_putsys(
break;
case CS_REFID:
- if (sys_stratum > 1 && sys_stratum < STRATUM_UNSPEC)
- ctl_putadr(sys_var[varid].text, sys_refid, NULL);
- else
+ if (REFID_ISTEXT(sys_stratum))
ctl_putrefid(sys_var[varid].text, sys_refid);
+ else
+ ctl_putadr(sys_var[varid].text, sys_refid, NULL);
break;
case CS_REFTIME:
@@ -2678,11 +2682,10 @@ ctl_putpeer(
break;
}
#endif
- if (p->stratum > 1 && p->stratum < STRATUM_UNSPEC)
- ctl_putadr(peer_var[id].text, p->refid,
- NULL);
- else
+ if (REFID_ISTEXT(p->stratum))
ctl_putrefid(peer_var[id].text, p->refid);
+ else
+ ctl_putadr(peer_var[id].text, p->refid, NULL);
break;
case CP_REFTIME:
@@ -3061,7 +3064,7 @@ ctl_getitem(
* packet; If it's EOV, it will never be NULL again until the
* variable is found and processed in a given 'var_list'. (That
* is, a result is returned that is neither NULL nor EOV).
- */
+ */
static const struct ctl_var eol = { 0, EOV, NULL };
static char buf[128];
static u_long quiet_until;
@@ -3101,7 +3104,7 @@ ctl_getitem(
++plhead;
while (plhead != pltail && isspace((u_char)pltail[-1]))
--pltail;
-
+
/* check payload size, terminate packet on overflow */
plsize = (size_t)(pltail - plhead);
if (plsize >= sizeof(buf))
@@ -3126,7 +3129,7 @@ ctl_getitem(
* variable lists after an EoV was returned. (Such a behavior
* actually caused Bug 3008.)
*/
-
+
if (NULL == var_list)
return &eol;
@@ -3647,7 +3650,7 @@ static u_int32 derive_nonce(
/* [Bug 3457] set flags and don't kill them again */
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
EVP_DigestInit_ex(ctx, EVP_get_digestbynid(NID_md5), NULL);
-# else
+# else
EVP_DigestInit(ctx, EVP_get_digestbynid(NID_md5));
# endif
EVP_DigestUpdate(ctx, salt, sizeof(salt));
@@ -3944,7 +3947,7 @@ static void read_mru_list(
int restrict_mask
)
{
- static const char nulltxt[1] = { '\0' };
+ static const char nulltxt[1] = { '\0' };
static const char nonce_text[] = "nonce";
static const char frags_text[] = "frags";
static const char limit_text[] = "limit";
@@ -3954,7 +3957,7 @@ static void read_mru_list(
static const char maxlstint_text[] = "maxlstint";
static const char laddr_text[] = "laddr";
static const char resaxx_fmt[] = "0x%hx";
-
+
u_int limit;
u_short frags;
u_short resall;
diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c
index ed5f0dcaff40..b89b996e9310 100644
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -1612,6 +1612,34 @@ set_wildcard_reuse(
}
#endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */
+static isc_boolean_t
+check_flags(
+ sockaddr_u *psau,
+ const char *name,
+ u_int32 flags
+ )
+{
+#if defined(SIOCGIFAFLAG_IN)
+ struct ifreq ifr;
+ int fd;
+
+ if (psau->sa.sa_family != AF_INET)
+ return ISC_FALSE;
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ return ISC_FALSE;
+ ZERO(ifr);
+ memcpy(&ifr.ifr_addr, &psau->sa, sizeof(ifr.ifr_addr));
+ strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFAFLAG_IN, &ifr) < 0) {
+ close(fd);
+ return ISC_FALSE;
+ }
+ close(fd);
+ if ((ifr.ifr_addrflags & flags) != 0)
+ return ISC_TRUE;
+#endif /* SIOCGIFAFLAG_IN */
+ return ISC_FALSE;
+}
static isc_boolean_t
check_flags6(
@@ -1661,19 +1689,32 @@ is_valid(
const char *name
)
{
- u_int32 flags6;
+ u_int32 flags;
- flags6 = 0;
+ flags = 0;
+ switch (psau->sa.sa_family) {
+ case AF_INET:
+#ifdef IN_IFF_DETACHED
+ flags |= IN_IFF_DETACHED;
+#endif
+#ifdef IN_IFF_TENTATIVE
+ flags |= IN_IFF_TENTATIVE;
+#endif
+ return check_flags(psau, name, flags) ? ISC_FALSE : ISC_TRUE;
+ case AF_INET6:
#ifdef IN6_IFF_DEPARTED
- flags6 |= IN6_IFF_DEPARTED;
+ flags |= IN6_IFF_DEPARTED;
#endif
#ifdef IN6_IFF_DETACHED
- flags6 |= IN6_IFF_DETACHED;
+ flags |= IN6_IFF_DETACHED;
#endif
#ifdef IN6_IFF_TENTATIVE
- flags6 |= IN6_IFF_TENTATIVE;
+ flags |= IN6_IFF_TENTATIVE;
#endif
- return check_flags6(psau, name, flags6) ? ISC_FALSE : ISC_TRUE;
+ return check_flags6(psau, name, flags) ? ISC_FALSE : ISC_TRUE;
+ default:
+ return ISC_FALSE;
+ }
}
/*
@@ -3092,7 +3133,7 @@ sendpkt(
int cc;
int rc;
u_char cttl;
- l_fp fp_zero = { 0, 0 };
+ l_fp fp_zero = { { 0 }, 0 };
ismcast = IS_MCAST(dest);
if (!ismcast)
diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c
index 8d44fb17db4e..924d5738b1e4 100644
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -1099,10 +1099,14 @@ start_kern_loop(void)
pll_control = TRUE;
ZERO(ntv);
ntv.modes = MOD_BITS;
- ntv.status = STA_PLL;
- ntv.maxerror = MAXDISPERSE;
- ntv.esterror = MAXDISPERSE;
- ntv.constant = sys_poll; /* why is it that here constant is unconditionally set to sys_poll, whereas elsewhere is is modified depending on nanosecond vs. microsecond kernel? */
+ ntv.status = STA_PLL | STA_UNSYNC;
+ ntv.maxerror = MAXDISPERSE * 1.0e6;
+ ntv.esterror = MAXDISPERSE * 1.0e6;
+ ntv.constant = sys_poll;
+ /* ^^^^^^^^ why is it that here constant is
+ * unconditionally set to sys_poll, whereas elsewhere is is
+ * modified depending on nanosecond vs. microsecond kernel?
+ */
#ifdef SIGSYS
/*
* Use sigsetjmp() to save state and then call ntp_adjtime(); if
diff --git a/ntpd/ntp_parser.c b/ntpd/ntp_parser.c
index 782019cdfa0c..8156a5f51f4d 100644
--- a/ntpd/ntp_parser.c
+++ b/ntpd/ntp_parser.c
@@ -62,7 +62,7 @@
/* Copy the first part of user declarations. */
-#line 11 "../../ntpd/ntp_parser.y" /* yacc.c:339 */
+#line 11 "ntp_parser.y" /* yacc.c:339 */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -76,6 +76,7 @@
#include "ntp_scanner.h"
#include "ntp_config.h"
#include "ntp_crypto.h"
+ #include "ntp_calendar.h"
#include "ntpsim.h" /* HMS: Do we really want this all the time? */
/* SK: It might be a good idea to always
@@ -96,7 +97,7 @@
# define ONLY_SIM(a) NULL
#endif
-#line 100 "ntp_parser.c" /* yacc.c:339 */
+#line 101 "ntp_parser.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -540,7 +541,7 @@ extern int yydebug;
union YYSTYPE
{
-#line 51 "../../ntpd/ntp_parser.y" /* yacc.c:355 */
+#line 52 "ntp_parser.y" /* yacc.c:355 */
char * String;
double Double;
@@ -559,7 +560,7 @@ union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
-#line 563 "ntp_parser.c" /* yacc.c:355 */
+#line 564 "ntp_parser.c" /* yacc.c:355 */
};
typedef union YYSTYPE YYSTYPE;
@@ -576,7 +577,7 @@ int yyparse (void);
/* Copy the second part of user declarations. */
-#line 580 "ntp_parser.c" /* yacc.c:358 */
+#line 581 "ntp_parser.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -893,39 +894,39 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 377, 377, 381, 382, 383, 398, 399, 400, 401,
- 402, 403, 404, 405, 406, 407, 408, 409, 410, 411,
- 419, 429, 430, 431, 432, 433, 437, 438, 443, 448,
- 450, 456, 457, 465, 466, 467, 471, 476, 477, 478,
- 479, 480, 481, 482, 483, 487, 489, 494, 495, 496,
- 497, 498, 499, 503, 508, 517, 527, 528, 538, 540,
- 542, 544, 555, 562, 564, 569, 571, 573, 575, 577,
- 587, 593, 594, 602, 604, 616, 617, 618, 619, 620,
- 629, 634, 639, 647, 649, 651, 653, 658, 659, 660,
- 661, 662, 663, 664, 665, 666, 670, 671, 680, 682,
- 691, 701, 706, 714, 715, 716, 717, 718, 719, 720,
- 721, 726, 727, 735, 745, 754, 769, 774, 775, 779,
- 780, 784, 785, 786, 787, 788, 789, 790, 799, 803,
- 807, 815, 823, 831, 846, 861, 874, 875, 895, 896,
- 904, 905, 906, 907, 908, 909, 910, 911, 912, 913,
- 914, 915, 916, 917, 918, 919, 920, 924, 929, 937,
- 942, 943, 944, 948, 953, 961, 966, 967, 968, 969,
- 970, 971, 972, 973, 981, 991, 996, 1004, 1006, 1008,
- 1017, 1019, 1024, 1025, 1029, 1030, 1031, 1032, 1040, 1045,
- 1050, 1058, 1063, 1064, 1065, 1074, 1076, 1081, 1086, 1094,
- 1096, 1113, 1114, 1115, 1116, 1117, 1118, 1122, 1123, 1124,
- 1125, 1126, 1127, 1135, 1140, 1145, 1153, 1158, 1159, 1160,
- 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1176, 1177, 1178,
- 1185, 1192, 1199, 1215, 1234, 1236, 1238, 1240, 1242, 1244,
- 1251, 1256, 1257, 1258, 1262, 1266, 1275, 1276, 1280, 1281,
- 1282, 1286, 1297, 1315, 1327, 1332, 1334, 1339, 1340, 1348,
- 1350, 1358, 1363, 1371, 1396, 1403, 1413, 1414, 1418, 1419,
- 1420, 1421, 1425, 1426, 1427, 1431, 1436, 1441, 1449, 1450,
- 1451, 1452, 1453, 1454, 1455, 1465, 1470, 1478, 1483, 1491,
- 1493, 1497, 1502, 1507, 1515, 1520, 1528, 1537, 1538, 1542,
- 1543, 1547, 1555, 1573, 1577, 1582, 1590, 1595, 1596, 1600,
- 1605, 1613, 1618, 1623, 1628, 1633, 1641, 1646, 1651, 1659,
- 1664, 1665, 1666, 1667, 1668
+ 0, 378, 378, 382, 383, 384, 399, 400, 401, 402,
+ 403, 404, 405, 406, 407, 408, 409, 410, 411, 412,
+ 420, 430, 431, 432, 433, 434, 438, 439, 444, 449,
+ 451, 457, 458, 466, 467, 468, 472, 477, 478, 479,
+ 480, 481, 482, 483, 484, 488, 490, 495, 496, 497,
+ 498, 499, 500, 504, 509, 518, 528, 529, 539, 541,
+ 543, 545, 556, 563, 565, 570, 572, 574, 576, 578,
+ 588, 594, 595, 603, 605, 617, 618, 619, 620, 621,
+ 630, 635, 640, 648, 650, 652, 654, 659, 660, 661,
+ 662, 663, 664, 665, 666, 667, 671, 672, 681, 683,
+ 692, 702, 707, 715, 716, 717, 718, 719, 720, 721,
+ 722, 727, 728, 736, 746, 755, 770, 775, 776, 780,
+ 781, 785, 786, 787, 788, 789, 790, 791, 800, 804,
+ 808, 816, 824, 832, 847, 862, 875, 876, 896, 897,
+ 905, 906, 907, 908, 909, 910, 911, 912, 913, 914,
+ 915, 916, 917, 918, 919, 920, 921, 925, 930, 938,
+ 943, 944, 945, 949, 954, 962, 967, 968, 969, 970,
+ 971, 972, 973, 974, 982, 992, 997, 1005, 1007, 1009,
+ 1018, 1020, 1025, 1026, 1030, 1031, 1032, 1033, 1041, 1046,
+ 1051, 1059, 1064, 1065, 1066, 1075, 1077, 1082, 1087, 1095,
+ 1097, 1114, 1115, 1116, 1117, 1118, 1119, 1123, 1124, 1125,
+ 1126, 1127, 1128, 1136, 1141, 1146, 1154, 1159, 1160, 1161,
+ 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1177, 1178, 1179,
+ 1186, 1193, 1200, 1216, 1235, 1237, 1239, 1241, 1243, 1245,
+ 1252, 1257, 1258, 1259, 1263, 1267, 1276, 1277, 1281, 1282,
+ 1283, 1287, 1298, 1316, 1328, 1333, 1335, 1340, 1341, 1349,
+ 1351, 1359, 1364, 1372, 1397, 1404, 1414, 1415, 1419, 1420,
+ 1421, 1422, 1426, 1427, 1428, 1432, 1437, 1442, 1450, 1451,
+ 1452, 1453, 1454, 1455, 1456, 1466, 1471, 1479, 1484, 1492,
+ 1494, 1498, 1503, 1508, 1516, 1521, 1529, 1538, 1539, 1543,
+ 1544, 1548, 1556, 1574, 1578, 1583, 1591, 1596, 1597, 1601,
+ 1606, 1614, 1619, 1624, 1629, 1634, 1642, 1647, 1652, 1660,
+ 1665, 1666, 1667, 1668, 1669
};
#endif
@@ -2126,7 +2127,7 @@ yyreduce:
switch (yyn)
{
case 5:
-#line 384 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 385 "ntp_parser.y" /* yacc.c:1646 */
{
/* I will need to incorporate much more fine grained
* error messages. The following should suffice for
@@ -2139,85 +2140,85 @@ yyreduce:
ip_ctx->errpos.nline,
ip_ctx->errpos.ncol);
}
-#line 2143 "ntp_parser.c" /* yacc.c:1646 */
+#line 2144 "ntp_parser.c" /* yacc.c:1646 */
break;
case 20:
-#line 420 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 421 "ntp_parser.y" /* yacc.c:1646 */
{
peer_node *my_node;
my_node = create_peer_node((yyvsp[-2].Integer), (yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.peers, my_node);
}
-#line 2154 "ntp_parser.c" /* yacc.c:1646 */
+#line 2155 "ntp_parser.c" /* yacc.c:1646 */
break;
case 27:
-#line 439 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 440 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Address_node) = create_address_node((yyvsp[0].String), (yyvsp[-1].Integer)); }
-#line 2160 "ntp_parser.c" /* yacc.c:1646 */
+#line 2161 "ntp_parser.c" /* yacc.c:1646 */
break;
case 28:
-#line 444 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 445 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Address_node) = create_address_node((yyvsp[0].String), AF_UNSPEC); }
-#line 2166 "ntp_parser.c" /* yacc.c:1646 */
+#line 2167 "ntp_parser.c" /* yacc.c:1646 */
break;
case 29:
-#line 449 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 450 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = AF_INET; }
-#line 2172 "ntp_parser.c" /* yacc.c:1646 */
+#line 2173 "ntp_parser.c" /* yacc.c:1646 */
break;
case 30:
-#line 451 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 452 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = AF_INET6; }
-#line 2178 "ntp_parser.c" /* yacc.c:1646 */
+#line 2179 "ntp_parser.c" /* yacc.c:1646 */
break;
case 31:
-#line 456 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 457 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
-#line 2184 "ntp_parser.c" /* yacc.c:1646 */
+#line 2185 "ntp_parser.c" /* yacc.c:1646 */
break;
case 32:
-#line 458 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 459 "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 2193 "ntp_parser.c" /* yacc.c:1646 */
+#line 2194 "ntp_parser.c" /* yacc.c:1646 */
break;
case 36:
-#line 472 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 473 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2199 "ntp_parser.c" /* yacc.c:1646 */
+#line 2200 "ntp_parser.c" /* yacc.c:1646 */
break;
case 45:
-#line 488 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 489 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2205 "ntp_parser.c" /* yacc.c:1646 */
+#line 2206 "ntp_parser.c" /* yacc.c:1646 */
break;
case 46:
-#line 490 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 491 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_uval((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2211 "ntp_parser.c" /* yacc.c:1646 */
+#line 2212 "ntp_parser.c" /* yacc.c:1646 */
break;
case 53:
-#line 504 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 505 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2217 "ntp_parser.c" /* yacc.c:1646 */
+#line 2218 "ntp_parser.c" /* yacc.c:1646 */
break;
case 55:
-#line 518 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 519 "ntp_parser.y" /* yacc.c:1646 */
{
unpeer_node *my_node;
@@ -2225,85 +2226,85 @@ yyreduce:
if (my_node)
APPEND_G_FIFO(cfgt.unpeers, my_node);
}
-#line 2229 "ntp_parser.c" /* yacc.c:1646 */
+#line 2230 "ntp_parser.c" /* yacc.c:1646 */
break;
case 58:
-#line 539 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 540 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.broadcastclient = 1; }
-#line 2235 "ntp_parser.c" /* yacc.c:1646 */
+#line 2236 "ntp_parser.c" /* yacc.c:1646 */
break;
case 59:
-#line 541 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 542 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[0].Address_fifo)); }
-#line 2241 "ntp_parser.c" /* yacc.c:1646 */
+#line 2242 "ntp_parser.c" /* yacc.c:1646 */
break;
case 60:
-#line 543 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 544 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[0].Address_fifo)); }
-#line 2247 "ntp_parser.c" /* yacc.c:1646 */
+#line 2248 "ntp_parser.c" /* yacc.c:1646 */
break;
case 61:
-#line 545 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 546 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.mdnstries = (yyvsp[0].Integer); }
-#line 2253 "ntp_parser.c" /* yacc.c:1646 */
+#line 2254 "ntp_parser.c" /* yacc.c:1646 */
break;
case 62:
-#line 556 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 557 "ntp_parser.y" /* yacc.c:1646 */
{
attr_val *atrv;
atrv = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
APPEND_G_FIFO(cfgt.vars, atrv);
}
-#line 2264 "ntp_parser.c" /* yacc.c:1646 */
+#line 2265 "ntp_parser.c" /* yacc.c:1646 */
break;
case 63:
-#line 563 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 564 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.auth.control_key = (yyvsp[0].Integer); }
-#line 2270 "ntp_parser.c" /* yacc.c:1646 */
+#line 2271 "ntp_parser.c" /* yacc.c:1646 */
break;
case 64:
-#line 565 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 566 "ntp_parser.y" /* yacc.c:1646 */
{
cfgt.auth.cryptosw++;
CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[0].Attr_val_fifo));
}
-#line 2279 "ntp_parser.c" /* yacc.c:1646 */
+#line 2280 "ntp_parser.c" /* yacc.c:1646 */
break;
case 65:
-#line 570 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 571 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.auth.keys = (yyvsp[0].String); }
-#line 2285 "ntp_parser.c" /* yacc.c:1646 */
+#line 2286 "ntp_parser.c" /* yacc.c:1646 */
break;
case 66:
-#line 572 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 573 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.auth.keysdir = (yyvsp[0].String); }
-#line 2291 "ntp_parser.c" /* yacc.c:1646 */
+#line 2292 "ntp_parser.c" /* yacc.c:1646 */
break;
case 67:
-#line 574 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 575 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.auth.request_key = (yyvsp[0].Integer); }
-#line 2297 "ntp_parser.c" /* yacc.c:1646 */
+#line 2298 "ntp_parser.c" /* yacc.c:1646 */
break;
case 68:
-#line 576 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 577 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.auth.revoke = (yyvsp[0].Integer); }
-#line 2303 "ntp_parser.c" /* yacc.c:1646 */
+#line 2304 "ntp_parser.c" /* yacc.c:1646 */
break;
case 69:
-#line 578 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 579 "ntp_parser.y" /* yacc.c:1646 */
{
/* [Bug 948] leaves it open if appending or
* replacing the trusted key list is the right
@@ -2313,38 +2314,38 @@ yyreduce:
DESTROY_G_FIFO(cfgt.auth.trusted_key_list, destroy_attr_val); /* remove for append */
CONCAT_G_FIFOS(cfgt.auth.trusted_key_list, (yyvsp[0].Attr_val_fifo));
}
-#line 2317 "ntp_parser.c" /* yacc.c:1646 */
+#line 2318 "ntp_parser.c" /* yacc.c:1646 */
break;
case 70:
-#line 588 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 589 "ntp_parser.y" /* yacc.c:1646 */
{ cfgt.auth.ntp_signd_socket = (yyvsp[0].String); }
-#line 2323 "ntp_parser.c" /* yacc.c:1646 */
+#line 2324 "ntp_parser.c" /* yacc.c:1646 */
break;
case 71:
-#line 593 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 594 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
-#line 2329 "ntp_parser.c" /* yacc.c:1646 */
+#line 2330 "ntp_parser.c" /* yacc.c:1646 */
break;
case 72:
-#line 595 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 596 "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 2338 "ntp_parser.c" /* yacc.c:1646 */
+#line 2339 "ntp_parser.c" /* yacc.c:1646 */
break;
case 73:
-#line 603 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 604 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2344 "ntp_parser.c" /* yacc.c:1646 */
+#line 2345 "ntp_parser.c" /* yacc.c:1646 */
break;
case 74:
-#line 605 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 606 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val) = NULL;
cfgt.auth.revoke = (yyvsp[0].Integer);
@@ -2353,65 +2354,65 @@ yyreduce:
"please use 'revoke %d' instead.",
cfgt.auth.revoke, cfgt.auth.revoke);
}
-#line 2357 "ntp_parser.c" /* yacc.c:1646 */
+#line 2358 "ntp_parser.c" /* yacc.c:1646 */
break;
case 80:
-#line 630 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 631 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[0].Attr_val_fifo)); }
-#line 2363 "ntp_parser.c" /* yacc.c:1646 */
+#line 2364 "ntp_parser.c" /* yacc.c:1646 */
break;
case 81:
-#line 635 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 636 "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 2372 "ntp_parser.c" /* yacc.c:1646 */
+#line 2373 "ntp_parser.c" /* yacc.c:1646 */
break;
case 82:
-#line 640 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 641 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2381 "ntp_parser.c" /* yacc.c:1646 */
+#line 2382 "ntp_parser.c" /* yacc.c:1646 */
break;
case 83:
-#line 648 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 649 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
-#line 2387 "ntp_parser.c" /* yacc.c:1646 */
+#line 2388 "ntp_parser.c" /* yacc.c:1646 */
break;
case 84:
-#line 650 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 651 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2393 "ntp_parser.c" /* yacc.c:1646 */
+#line 2394 "ntp_parser.c" /* yacc.c:1646 */
break;
case 85:
-#line 652 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 653 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
-#line 2399 "ntp_parser.c" /* yacc.c:1646 */
+#line 2400 "ntp_parser.c" /* yacc.c:1646 */
break;
case 86:
-#line 654 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 655 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival(T_Basedate, (yyvsp[0].Integer)); }
-#line 2405 "ntp_parser.c" /* yacc.c:1646 */
+#line 2406 "ntp_parser.c" /* yacc.c:1646 */
break;
case 98:
-#line 681 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 682 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[0].Int_fifo)); }
-#line 2411 "ntp_parser.c" /* yacc.c:1646 */
+#line 2412 "ntp_parser.c" /* yacc.c:1646 */
break;
case 99:
-#line 683 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 684 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
cfgt.stats_dir = (yyvsp[0].String);
@@ -2420,55 +2421,55 @@ yyreduce:
yyerror("statsdir remote configuration ignored");
}
}
-#line 2424 "ntp_parser.c" /* yacc.c:1646 */
+#line 2425 "ntp_parser.c" /* yacc.c:1646 */
break;
case 100:
-#line 692 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 693 "ntp_parser.y" /* yacc.c:1646 */
{
filegen_node *fgn;
fgn = create_filegen_node((yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.filegen_opts, fgn);
}
-#line 2435 "ntp_parser.c" /* yacc.c:1646 */
+#line 2436 "ntp_parser.c" /* yacc.c:1646 */
break;
case 101:
-#line 702 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 703 "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 2444 "ntp_parser.c" /* yacc.c:1646 */
+#line 2445 "ntp_parser.c" /* yacc.c:1646 */
break;
case 102:
-#line 707 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 708 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Int_fifo) = NULL;
APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
-#line 2453 "ntp_parser.c" /* yacc.c:1646 */
+#line 2454 "ntp_parser.c" /* yacc.c:1646 */
break;
case 111:
-#line 726 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 727 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
-#line 2459 "ntp_parser.c" /* yacc.c:1646 */
+#line 2460 "ntp_parser.c" /* yacc.c:1646 */
break;
case 112:
-#line 728 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 729 "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 2468 "ntp_parser.c" /* yacc.c:1646 */
+#line 2469 "ntp_parser.c" /* yacc.c:1646 */
break;
case 113:
-#line 736 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 737 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
(yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
@@ -2478,11 +2479,11 @@ yyreduce:
yyerror("filegen file remote config ignored");
}
}
-#line 2482 "ntp_parser.c" /* yacc.c:1646 */
+#line 2483 "ntp_parser.c" /* yacc.c:1646 */
break;
case 114:
-#line 746 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 747 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
(yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
@@ -2491,11 +2492,11 @@ yyreduce:
yyerror("filegen type remote config ignored");
}
}
-#line 2495 "ntp_parser.c" /* yacc.c:1646 */
+#line 2496 "ntp_parser.c" /* yacc.c:1646 */
break;
case 115:
-#line 755 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 756 "ntp_parser.y" /* yacc.c:1646 */
{
const char *err;
@@ -2510,33 +2511,33 @@ yyreduce:
yyerror(err);
}
}
-#line 2514 "ntp_parser.c" /* yacc.c:1646 */
+#line 2515 "ntp_parser.c" /* yacc.c:1646 */
break;
case 116:
-#line 770 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 771 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2520 "ntp_parser.c" /* yacc.c:1646 */
+#line 2521 "ntp_parser.c" /* yacc.c:1646 */
break;
case 128:
-#line 800 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 801 "ntp_parser.y" /* yacc.c:1646 */
{
CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[0].Attr_val_fifo));
}
-#line 2528 "ntp_parser.c" /* yacc.c:1646 */
+#line 2529 "ntp_parser.c" /* yacc.c:1646 */
break;
case 129:
-#line 804 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 805 "ntp_parser.y" /* yacc.c:1646 */
{
CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[0].Attr_val_fifo));
}
-#line 2536 "ntp_parser.c" /* yacc.c:1646 */
+#line 2537 "ntp_parser.c" /* yacc.c:1646 */
break;
case 130:
-#line 808 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 809 "ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2544,11 +2545,11 @@ yyreduce:
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2548 "ntp_parser.c" /* yacc.c:1646 */
+#line 2549 "ntp_parser.c" /* yacc.c:1646 */
break;
case 131:
-#line 816 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 817 "ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2556,11 +2557,11 @@ yyreduce:
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2560 "ntp_parser.c" /* yacc.c:1646 */
+#line 2561 "ntp_parser.c" /* yacc.c:1646 */
break;
case 132:
-#line 824 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 825 "ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2568,11 +2569,11 @@ yyreduce:
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2572 "ntp_parser.c" /* yacc.c:1646 */
+#line 2573 "ntp_parser.c" /* yacc.c:1646 */
break;
case 133:
-#line 832 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 833 "ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2587,11 +2588,11 @@ yyreduce:
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2591 "ntp_parser.c" /* yacc.c:1646 */
+#line 2592 "ntp_parser.c" /* yacc.c:1646 */
break;
case 134:
-#line 847 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 848 "ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2606,11 +2607,11 @@ yyreduce:
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2610 "ntp_parser.c" /* yacc.c:1646 */
+#line 2611 "ntp_parser.c" /* yacc.c:1646 */
break;
case 135:
-#line 862 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 863 "ntp_parser.y" /* yacc.c:1646 */
{
restrict_node * rn;
@@ -2619,17 +2620,17 @@ yyreduce:
NULL, NULL, (yyvsp[-1].Integer), (yyvsp[0].Int_fifo), lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
-#line 2623 "ntp_parser.c" /* yacc.c:1646 */
+#line 2624 "ntp_parser.c" /* yacc.c:1646 */
break;
case 136:
-#line 874 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 875 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = -1; }
-#line 2629 "ntp_parser.c" /* yacc.c:1646 */
+#line 2630 "ntp_parser.c" /* yacc.c:1646 */
break;
case 137:
-#line 876 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 877 "ntp_parser.y" /* yacc.c:1646 */
{
if (((yyvsp[0].Integer) < -1) || ((yyvsp[0].Integer) > 100)) {
struct FILE_INFO * ip_ctx;
@@ -2645,115 +2646,115 @@ yyreduce:
}
(yyval.Integer) = (yyvsp[0].Integer);
}
-#line 2649 "ntp_parser.c" /* yacc.c:1646 */
+#line 2650 "ntp_parser.c" /* yacc.c:1646 */
break;
case 138:
-#line 895 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 896 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Int_fifo) = NULL; }
-#line 2655 "ntp_parser.c" /* yacc.c:1646 */
+#line 2656 "ntp_parser.c" /* yacc.c:1646 */
break;
case 139:
-#line 897 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 898 "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 2664 "ntp_parser.c" /* yacc.c:1646 */
+#line 2665 "ntp_parser.c" /* yacc.c:1646 */
break;
case 157:
-#line 925 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 926 "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 2673 "ntp_parser.c" /* yacc.c:1646 */
+#line 2674 "ntp_parser.c" /* yacc.c:1646 */
break;
case 158:
-#line 930 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 931 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2682 "ntp_parser.c" /* yacc.c:1646 */
+#line 2683 "ntp_parser.c" /* yacc.c:1646 */
break;
case 159:
-#line 938 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 939 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2688 "ntp_parser.c" /* yacc.c:1646 */
+#line 2689 "ntp_parser.c" /* yacc.c:1646 */
break;
case 163:
-#line 949 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 950 "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 2697 "ntp_parser.c" /* yacc.c:1646 */
+#line 2698 "ntp_parser.c" /* yacc.c:1646 */
break;
case 164:
-#line 954 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 955 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2706 "ntp_parser.c" /* yacc.c:1646 */
+#line 2707 "ntp_parser.c" /* yacc.c:1646 */
break;
case 165:
-#line 962 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 963 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2712 "ntp_parser.c" /* yacc.c:1646 */
+#line 2713 "ntp_parser.c" /* yacc.c:1646 */
break;
case 174:
-#line 982 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 983 "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.fudge, aon);
}
-#line 2723 "ntp_parser.c" /* yacc.c:1646 */
+#line 2724 "ntp_parser.c" /* yacc.c:1646 */
break;
case 175:
-#line 992 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 993 "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 2732 "ntp_parser.c" /* yacc.c:1646 */
+#line 2733 "ntp_parser.c" /* yacc.c:1646 */
break;
case 176:
-#line 997 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 998 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2741 "ntp_parser.c" /* yacc.c:1646 */
+#line 2742 "ntp_parser.c" /* yacc.c:1646 */
break;
case 177:
-#line 1005 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1006 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2747 "ntp_parser.c" /* yacc.c:1646 */
+#line 2748 "ntp_parser.c" /* yacc.c:1646 */
break;
case 178:
-#line 1007 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1008 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2753 "ntp_parser.c" /* yacc.c:1646 */
+#line 2754 "ntp_parser.c" /* yacc.c:1646 */
break;
case 179:
-#line 1009 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1010 "ntp_parser.y" /* yacc.c:1646 */
{
if ((yyvsp[0].Integer) >= 0 && (yyvsp[0].Integer) <= 16) {
(yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
@@ -2762,89 +2763,89 @@ yyreduce:
yyerror("fudge factor: stratum value not in [0..16], ignored");
}
}
-#line 2766 "ntp_parser.c" /* yacc.c:1646 */
+#line 2767 "ntp_parser.c" /* yacc.c:1646 */
break;
case 180:
-#line 1018 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1019 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2772 "ntp_parser.c" /* yacc.c:1646 */
+#line 2773 "ntp_parser.c" /* yacc.c:1646 */
break;
case 181:
-#line 1020 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1021 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
-#line 2778 "ntp_parser.c" /* yacc.c:1646 */
+#line 2779 "ntp_parser.c" /* yacc.c:1646 */
break;
case 188:
-#line 1041 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1042 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); }
-#line 2784 "ntp_parser.c" /* yacc.c:1646 */
+#line 2785 "ntp_parser.c" /* yacc.c:1646 */
break;
case 189:
-#line 1046 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1047 "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 2793 "ntp_parser.c" /* yacc.c:1646 */
+#line 2794 "ntp_parser.c" /* yacc.c:1646 */
break;
case 190:
-#line 1051 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1052 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2802 "ntp_parser.c" /* yacc.c:1646 */
+#line 2803 "ntp_parser.c" /* yacc.c:1646 */
break;
case 191:
-#line 1059 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1060 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 2808 "ntp_parser.c" /* yacc.c:1646 */
+#line 2809 "ntp_parser.c" /* yacc.c:1646 */
break;
case 195:
-#line 1075 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1076 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); }
-#line 2814 "ntp_parser.c" /* yacc.c:1646 */
+#line 2815 "ntp_parser.c" /* yacc.c:1646 */
break;
case 196:
-#line 1077 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1078 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); }
-#line 2820 "ntp_parser.c" /* yacc.c:1646 */
+#line 2821 "ntp_parser.c" /* yacc.c:1646 */
break;
case 197:
-#line 1082 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1083 "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 2829 "ntp_parser.c" /* yacc.c:1646 */
+#line 2830 "ntp_parser.c" /* yacc.c:1646 */
break;
case 198:
-#line 1087 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1088 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2838 "ntp_parser.c" /* yacc.c:1646 */
+#line 2839 "ntp_parser.c" /* yacc.c:1646 */
break;
case 199:
-#line 1095 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1096 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
-#line 2844 "ntp_parser.c" /* yacc.c:1646 */
+#line 2845 "ntp_parser.c" /* yacc.c:1646 */
break;
case 200:
-#line 1097 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1098 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
(yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
@@ -2858,74 +2859,74 @@ yyreduce:
yyerror(err_str);
}
}
-#line 2862 "ntp_parser.c" /* yacc.c:1646 */
+#line 2863 "ntp_parser.c" /* yacc.c:1646 */
break;
case 213:
-#line 1136 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1137 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); }
-#line 2868 "ntp_parser.c" /* yacc.c:1646 */
+#line 2869 "ntp_parser.c" /* yacc.c:1646 */
break;
case 214:
-#line 1141 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1142 "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 2877 "ntp_parser.c" /* yacc.c:1646 */
+#line 2878 "ntp_parser.c" /* yacc.c:1646 */
break;
case 215:
-#line 1146 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1147 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 2886 "ntp_parser.c" /* yacc.c:1646 */
+#line 2887 "ntp_parser.c" /* yacc.c:1646 */
break;
case 216:
-#line 1154 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1155 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
-#line 2892 "ntp_parser.c" /* yacc.c:1646 */
+#line 2893 "ntp_parser.c" /* yacc.c:1646 */
break;
case 229:
-#line 1179 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1180 "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 2903 "ntp_parser.c" /* yacc.c:1646 */
+#line 2904 "ntp_parser.c" /* yacc.c:1646 */
break;
case 230:
-#line 1186 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1187 "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 2914 "ntp_parser.c" /* yacc.c:1646 */
+#line 2915 "ntp_parser.c" /* yacc.c:1646 */
break;
case 231:
-#line 1193 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1194 "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 2925 "ntp_parser.c" /* yacc.c:1646 */
+#line 2926 "ntp_parser.c" /* yacc.c:1646 */
break;
case 232:
-#line 1200 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1201 "ntp_parser.y" /* yacc.c:1646 */
{
char error_text[64];
attr_val *av;
@@ -2941,11 +2942,11 @@ yyreduce:
yyerror(error_text);
}
}
-#line 2945 "ntp_parser.c" /* yacc.c:1646 */
+#line 2946 "ntp_parser.c" /* yacc.c:1646 */
break;
case 233:
-#line 1216 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1217 "ntp_parser.y" /* yacc.c:1646 */
{
if (!lex_from_file()) {
YYFREE((yyvsp[-1].String)); /* avoid leak */
@@ -2964,68 +2965,68 @@ yyreduce:
}
YYFREE((yyvsp[-1].String)); /* avoid leak */
}
-#line 2968 "ntp_parser.c" /* yacc.c:1646 */
+#line 2969 "ntp_parser.c" /* yacc.c:1646 */
break;
case 234:
-#line 1235 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1236 "ntp_parser.y" /* yacc.c:1646 */
{ lex_flush_stack(); }
-#line 2974 "ntp_parser.c" /* yacc.c:1646 */
+#line 2975 "ntp_parser.c" /* yacc.c:1646 */
break;
case 235:
-#line 1237 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1238 "ntp_parser.y" /* yacc.c:1646 */
{ /* see drift_parm below for actions */ }
-#line 2980 "ntp_parser.c" /* yacc.c:1646 */
+#line 2981 "ntp_parser.c" /* yacc.c:1646 */
break;
case 236:
-#line 1239 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1240 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); }
-#line 2986 "ntp_parser.c" /* yacc.c:1646 */
+#line 2987 "ntp_parser.c" /* yacc.c:1646 */
break;
case 237:
-#line 1241 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1242 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); }
-#line 2992 "ntp_parser.c" /* yacc.c:1646 */
+#line 2993 "ntp_parser.c" /* yacc.c:1646 */
break;
case 238:
-#line 1243 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1244 "ntp_parser.y" /* yacc.c:1646 */
{ APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); }
-#line 2998 "ntp_parser.c" /* yacc.c:1646 */
+#line 2999 "ntp_parser.c" /* yacc.c:1646 */
break;
case 239:
-#line 1245 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1246 "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 3009 "ntp_parser.c" /* yacc.c:1646 */
+#line 3010 "ntp_parser.c" /* yacc.c:1646 */
break;
case 240:
-#line 1252 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1253 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); }
-#line 3015 "ntp_parser.c" /* yacc.c:1646 */
+#line 3016 "ntp_parser.c" /* yacc.c:1646 */
break;
case 245:
-#line 1267 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1268 "ntp_parser.y" /* yacc.c:1646 */
{
#ifndef LEAP_SMEAR
yyerror("Built without LEAP_SMEAR support.");
#endif
}
-#line 3025 "ntp_parser.c" /* yacc.c:1646 */
+#line 3026 "ntp_parser.c" /* yacc.c:1646 */
break;
case 251:
-#line 1287 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1288 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
attr_val *av;
@@ -3036,11 +3037,11 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 3040 "ntp_parser.c" /* yacc.c:1646 */
+#line 3041 "ntp_parser.c" /* yacc.c:1646 */
break;
case 252:
-#line 1298 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1299 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
attr_val *av;
@@ -3057,11 +3058,11 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 3061 "ntp_parser.c" /* yacc.c:1646 */
+#line 3062 "ntp_parser.c" /* yacc.c:1646 */
break;
case 253:
-#line 1315 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1316 "ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
attr_val *av;
@@ -3071,71 +3072,71 @@ yyreduce:
yyerror("driftfile remote configuration ignored");
}
}
-#line 3075 "ntp_parser.c" /* yacc.c:1646 */
+#line 3076 "ntp_parser.c" /* yacc.c:1646 */
break;
case 254:
-#line 1328 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1329 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); }
-#line 3081 "ntp_parser.c" /* yacc.c:1646 */
+#line 3082 "ntp_parser.c" /* yacc.c:1646 */
break;
case 256:
-#line 1334 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1335 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 0; }
-#line 3087 "ntp_parser.c" /* yacc.c:1646 */
+#line 3088 "ntp_parser.c" /* yacc.c:1646 */
break;
case 257:
-#line 1339 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1340 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
-#line 3093 "ntp_parser.c" /* yacc.c:1646 */
+#line 3094 "ntp_parser.c" /* yacc.c:1646 */
break;
case 258:
-#line 1341 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1342 "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 3102 "ntp_parser.c" /* yacc.c:1646 */
+#line 3103 "ntp_parser.c" /* yacc.c:1646 */
break;
case 259:
-#line 1349 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1350 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
-#line 3108 "ntp_parser.c" /* yacc.c:1646 */
+#line 3109 "ntp_parser.c" /* yacc.c:1646 */
break;
case 260:
-#line 1351 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1352 "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 3117 "ntp_parser.c" /* yacc.c:1646 */
+#line 3118 "ntp_parser.c" /* yacc.c:1646 */
break;
case 261:
-#line 1359 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1360 "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 3126 "ntp_parser.c" /* yacc.c:1646 */
+#line 3127 "ntp_parser.c" /* yacc.c:1646 */
break;
case 262:
-#line 1364 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1365 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3135 "ntp_parser.c" /* yacc.c:1646 */
+#line 3136 "ntp_parser.c" /* yacc.c:1646 */
break;
case 263:
-#line 1372 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1373 "ntp_parser.y" /* yacc.c:1646 */
{
char prefix;
char * type;
@@ -3157,141 +3158,141 @@ yyreduce:
(yyval.Attr_val) = create_attr_sval(prefix, estrdup(type));
YYFREE((yyvsp[0].String));
}
-#line 3161 "ntp_parser.c" /* yacc.c:1646 */
+#line 3162 "ntp_parser.c" /* yacc.c:1646 */
break;
case 264:
-#line 1397 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1398 "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 3172 "ntp_parser.c" /* yacc.c:1646 */
+#line 3173 "ntp_parser.c" /* yacc.c:1646 */
break;
case 265:
-#line 1404 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1405 "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 3183 "ntp_parser.c" /* yacc.c:1646 */
+#line 3184 "ntp_parser.c" /* yacc.c:1646 */
break;
case 275:
-#line 1432 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1433 "ntp_parser.y" /* yacc.c:1646 */
{ CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); }
-#line 3189 "ntp_parser.c" /* yacc.c:1646 */
+#line 3190 "ntp_parser.c" /* yacc.c:1646 */
break;
case 276:
-#line 1437 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1438 "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 3198 "ntp_parser.c" /* yacc.c:1646 */
+#line 3199 "ntp_parser.c" /* yacc.c:1646 */
break;
case 277:
-#line 1442 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1443 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Int_fifo) = NULL;
APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
-#line 3207 "ntp_parser.c" /* yacc.c:1646 */
+#line 3208 "ntp_parser.c" /* yacc.c:1646 */
break;
case 285:
-#line 1466 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1467 "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 3216 "ntp_parser.c" /* yacc.c:1646 */
+#line 3217 "ntp_parser.c" /* yacc.c:1646 */
break;
case 286:
-#line 1471 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1472 "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 3225 "ntp_parser.c" /* yacc.c:1646 */
+#line 3226 "ntp_parser.c" /* yacc.c:1646 */
break;
case 287:
-#line 1479 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1480 "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 3234 "ntp_parser.c" /* yacc.c:1646 */
+#line 3235 "ntp_parser.c" /* yacc.c:1646 */
break;
case 288:
-#line 1484 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1485 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
-#line 3243 "ntp_parser.c" /* yacc.c:1646 */
+#line 3244 "ntp_parser.c" /* yacc.c:1646 */
break;
case 289:
-#line 1492 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1493 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); }
-#line 3249 "ntp_parser.c" /* yacc.c:1646 */
+#line 3250 "ntp_parser.c" /* yacc.c:1646 */
break;
case 291:
-#line 1498 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1499 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); }
-#line 3255 "ntp_parser.c" /* yacc.c:1646 */
+#line 3256 "ntp_parser.c" /* yacc.c:1646 */
break;
case 292:
-#line 1503 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1504 "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 3264 "ntp_parser.c" /* yacc.c:1646 */
+#line 3265 "ntp_parser.c" /* yacc.c:1646 */
break;
case 293:
-#line 1508 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1509 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.String_fifo) = NULL;
APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
}
-#line 3273 "ntp_parser.c" /* yacc.c:1646 */
+#line 3274 "ntp_parser.c" /* yacc.c:1646 */
break;
case 294:
-#line 1516 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1517 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Address_fifo) = (yyvsp[-1].Address_fifo);
APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
}
-#line 3282 "ntp_parser.c" /* yacc.c:1646 */
+#line 3283 "ntp_parser.c" /* yacc.c:1646 */
break;
case 295:
-#line 1521 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1522 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Address_fifo) = NULL;
APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
}
-#line 3291 "ntp_parser.c" /* yacc.c:1646 */
+#line 3292 "ntp_parser.c" /* yacc.c:1646 */
break;
case 296:
-#line 1529 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1530 "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");
@@ -3300,35 +3301,35 @@ yyreduce:
(yyval.Integer) = (yyvsp[0].Integer);
}
}
-#line 3304 "ntp_parser.c" /* yacc.c:1646 */
+#line 3305 "ntp_parser.c" /* yacc.c:1646 */
break;
case 297:
-#line 1537 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1538 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 1; }
-#line 3310 "ntp_parser.c" /* yacc.c:1646 */
+#line 3311 "ntp_parser.c" /* yacc.c:1646 */
break;
case 298:
-#line 1538 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1539 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 0; }
-#line 3316 "ntp_parser.c" /* yacc.c:1646 */
+#line 3317 "ntp_parser.c" /* yacc.c:1646 */
break;
case 299:
-#line 1542 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1543 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Double) = (double)(yyvsp[0].Integer); }
-#line 3322 "ntp_parser.c" /* yacc.c:1646 */
+#line 3323 "ntp_parser.c" /* yacc.c:1646 */
break;
case 301:
-#line 1548 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1549 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = basedate_eval_string((yyvsp[0].String)); YYFREE((yyvsp[0].String)); }
-#line 3328 "ntp_parser.c" /* yacc.c:1646 */
+#line 3329 "ntp_parser.c" /* yacc.c:1646 */
break;
case 302:
-#line 1556 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1557 "ntp_parser.y" /* yacc.c:1646 */
{
sim_node *sn;
@@ -3338,125 +3339,125 @@ yyreduce:
/* Revert from ; to \n for end-of-command */
old_config_style = 1;
}
-#line 3342 "ntp_parser.c" /* yacc.c:1646 */
+#line 3343 "ntp_parser.c" /* yacc.c:1646 */
break;
case 303:
-#line 1573 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1574 "ntp_parser.y" /* yacc.c:1646 */
{ old_config_style = 0; }
-#line 3348 "ntp_parser.c" /* yacc.c:1646 */
+#line 3349 "ntp_parser.c" /* yacc.c:1646 */
break;
case 304:
-#line 1578 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1579 "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 3357 "ntp_parser.c" /* yacc.c:1646 */
+#line 3358 "ntp_parser.c" /* yacc.c:1646 */
break;
case 305:
-#line 1583 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1584 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
-#line 3366 "ntp_parser.c" /* yacc.c:1646 */
+#line 3367 "ntp_parser.c" /* yacc.c:1646 */
break;
case 306:
-#line 1591 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1592 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
-#line 3372 "ntp_parser.c" /* yacc.c:1646 */
+#line 3373 "ntp_parser.c" /* yacc.c:1646 */
break;
case 309:
-#line 1601 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1602 "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 3381 "ntp_parser.c" /* yacc.c:1646 */
+#line 3382 "ntp_parser.c" /* yacc.c:1646 */
break;
case 310:
-#line 1606 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1607 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_server_fifo) = NULL;
APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
}
-#line 3390 "ntp_parser.c" /* yacc.c:1646 */
+#line 3391 "ntp_parser.c" /* yacc.c:1646 */
break;
case 311:
-#line 1614 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1615 "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 3396 "ntp_parser.c" /* yacc.c:1646 */
+#line 3397 "ntp_parser.c" /* yacc.c:1646 */
break;
case 312:
-#line 1619 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1620 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Double) = (yyvsp[-1].Double); }
-#line 3402 "ntp_parser.c" /* yacc.c:1646 */
+#line 3403 "ntp_parser.c" /* yacc.c:1646 */
break;
case 313:
-#line 1624 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1625 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Address_node) = (yyvsp[0].Address_node); }
-#line 3408 "ntp_parser.c" /* yacc.c:1646 */
+#line 3409 "ntp_parser.c" /* yacc.c:1646 */
break;
case 314:
-#line 1629 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1630 "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 3417 "ntp_parser.c" /* yacc.c:1646 */
+#line 3418 "ntp_parser.c" /* yacc.c:1646 */
break;
case 315:
-#line 1634 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1635 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_script_fifo) = NULL;
APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
}
-#line 3426 "ntp_parser.c" /* yacc.c:1646 */
+#line 3427 "ntp_parser.c" /* yacc.c:1646 */
break;
case 316:
-#line 1642 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1643 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); }
-#line 3432 "ntp_parser.c" /* yacc.c:1646 */
+#line 3433 "ntp_parser.c" /* yacc.c:1646 */
break;
case 317:
-#line 1647 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1648 "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 3441 "ntp_parser.c" /* yacc.c:1646 */
+#line 3442 "ntp_parser.c" /* yacc.c:1646 */
break;
case 318:
-#line 1652 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1653 "ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
-#line 3450 "ntp_parser.c" /* yacc.c:1646 */
+#line 3451 "ntp_parser.c" /* yacc.c:1646 */
break;
case 319:
-#line 1660 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+#line 1661 "ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
-#line 3456 "ntp_parser.c" /* yacc.c:1646 */
+#line 3457 "ntp_parser.c" /* yacc.c:1646 */
break;
-#line 3460 "ntp_parser.c" /* yacc.c:1646 */
+#line 3461 "ntp_parser.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3684,7 +3685,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1671 "../../ntpd/ntp_parser.y" /* yacc.c:1906 */
+#line 1672 "ntp_parser.y" /* yacc.c:1906 */
void
diff --git a/ntpd/ntp_parser.h b/ntpd/ntp_parser.h
index 308c2d40583a..e24b3f41c61d 100644
--- a/ntpd/ntp_parser.h
+++ b/ntpd/ntp_parser.h
@@ -454,7 +454,7 @@ extern int yydebug;
union YYSTYPE
{
-#line 51 "../../ntpd/ntp_parser.y" /* yacc.c:1909 */
+#line 52 "ntp_parser.y" /* yacc.c:1909 */
char * String;
double Double;
diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y
index 02c7342196e5..e4da9739767a 100644
--- a/ntpd/ntp_parser.y
+++ b/ntpd/ntp_parser.y
@@ -21,6 +21,7 @@
#include "ntp_scanner.h"
#include "ntp_config.h"
#include "ntp_crypto.h"
+ #include "ntp_calendar.h"
#include "ntpsim.h" /* HMS: Do we really want this all the time? */
/* SK: It might be a good idea to always
diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c
index fb8a837db5c2..73ada6b442ba 100644
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -33,7 +33,7 @@
/*
* This macro defines the authentication state. If x is 1 authentication
- * is required; othewise it is optional.
+ * is required; otherwise it is optional.
*/
#define AUTH(x, y) ((x) ? (y) == AUTH_OK \
: (y) == AUTH_OK || (y) == AUTH_NONE)
@@ -272,7 +272,7 @@ kiss_code_check(
}
-/*
+/*
* Check that NAK is valid
*/
nak_code
@@ -315,7 +315,7 @@ valid_NAK(
return INVALIDNAK;
}
- /*
+ /*
* Make sure that the extra field in the packet is all zeros
*/
rpkt = &rbufp->recv_pkt;
@@ -324,10 +324,13 @@ valid_NAK(
return INVALIDNAK;
}
- /*
- * Only valid if peer uses a key
+ /*
+ * During the first few packets of the autokey dance there will
+ * not (yet) be a keyid, but in this case FLAG_SKEY is set.
+ * So the NAK is invalid if either there's no peer, or
+ * if the keyid is 0 and FLAG_SKEY is not set.
*/
- if (!peer || !peer->keyid || !(peer->flags & FLAG_SKEY)) {
+ if (!peer || (!peer->keyid && !(peer->flags & FLAG_SKEY))) {
return INVALIDNAK;
}
@@ -372,6 +375,13 @@ transmit(
hpoll = peer->hpoll;
/*
+ * If we haven't received anything (even if unsync) since last
+ * send, reset ppoll.
+ */
+ if (peer->outdate > peer->timelastrec && !peer->reach)
+ peer->ppoll = peer->maxpoll;
+
+ /*
* In broadcast mode the poll interval is never changed from
* minpoll.
*/
@@ -645,7 +655,7 @@ receive(
hisleap = PKT_LEAP(pkt->li_vn_mode);
hismode = (int)PKT_MODE(pkt->li_vn_mode);
hisstratum = PKT_TO_STRATUM(pkt->stratum);
- DPRINTF(2, ("receive: at %ld %s<-%s ippeerlimit %d mode %d iflags %s restrict %s org %#010x.%08x xmt %#010x.%08x\n",
+ DPRINTF(1, ("receive: at %ld %s<-%s ippeerlimit %d mode %d iflags %s restrict %s org %#010x.%08x xmt %#010x.%08x\n",
current_time, stoa(&rbufp->dstadr->sin),
stoa(&rbufp->recv_srcadr), r4a.ippeerlimit, hismode,
build_iflags(rbufp->dstadr->flags),
@@ -737,7 +747,7 @@ receive(
} else {
DPRINTF(2, ("receive: drop: MODE_UNSPEC\n"));
sys_badlength++;
- return; /* invalid mode */
+ return; /* invalid mode */
}
}
@@ -841,7 +851,7 @@ receive(
/*
** Packet Data Verification Layer
**
- ** This layer verifies the packet data content. If
+ ** This layer verifies the packet data content. If
** authentication is required, a MAC must be present.
** If a MAC is present, it must validate.
** Crypto-NAK? Look - a shiny thing!
@@ -949,7 +959,7 @@ receive(
if (0 != peer) {
peer->badNAK++;
}
- msyslog(LOG_ERR, "Invalid-NAK error at %ld %s<-%s",
+ msyslog(LOG_ERR, "Invalid-NAK error at %ld %s<-%s",
current_time, stoa(dstadr_sin), stoa(&rbufp->recv_srcadr));
return;
}
@@ -957,7 +967,7 @@ receive(
if (has_mac == 0) {
restrict_mask &= ~RES_MSSNTP;
is_authentic = AUTH_NONE; /* not required */
- DPRINTF(2, ("receive: at %ld %s<-%s mode %d/%s:%s len %d org %#010x.%08x xmt %#010x.%08x NOMAC\n",
+ DPRINTF(1, ("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, hm_str, am_str,
authlen,
@@ -966,7 +976,7 @@ receive(
} else if (crypto_nak_test == VALIDNAK) {
restrict_mask &= ~RES_MSSNTP;
is_authentic = AUTH_CRYPTO; /* crypto-NAK */
- 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",
+ DPRINTF(1, ("receive: at %ld %s<-%s mode %d/%s:%s keyid %08x len %d auth %d org %#010x.%08x xmt %#010x.%08x CRYPTONAK\n",
current_time, stoa(dstadr_sin),
stoa(&rbufp->recv_srcadr), hismode, hm_str, am_str,
skeyid, authlen + has_mac, is_authentic,
@@ -989,13 +999,19 @@ receive(
&& (memcmp(zero_key, (char *)pkt + authlen + 4,
MAX_MD5_LEN - 4) == 0)) {
is_authentic = AUTH_NONE;
+ DPRINTF(1, ("receive: at %ld %s<-%s mode %d/%s:%s len %d org %#010x.%08x xmt %#010x.%08x SIGND\n",
+ current_time, stoa(dstadr_sin),
+ 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)));
#endif /* HAVE_NTP_SIGND */
} else {
/*
* has_mac is not 0
* Not a VALID_NAK
- * Not an MS-SNTP SIGND packet
+ * Not an MS-SNTP SIGND packet
*
* So there is a MAC here.
*/
@@ -1054,7 +1070,7 @@ receive(
ANY_INTERFACE_CHOOSE(&rbufp->recv_srcadr)) {
DPRINTF(2, ("receive: drop: BCAST from wildcard\n"));
sys_restricted++;
- return; /* no wildcard */
+ return; /* no wildcard */
}
pkeyid = 0;
if (!SOCK_UNSPEC(&rbufp->dstadr->bcast))
@@ -1106,7 +1122,7 @@ receive(
if (crypto_flags && skeyid > NTP_MAXKEY)
authtrust(skeyid, 0);
#endif /* AUTOKEY */
- DPRINTF(2, ("receive: at %ld %s<-%s mode %d/%s:%s keyid %08x len %d auth %d org %#010x.%08x xmt %#010x.%08x\n",
+ DPRINTF(1, ("receive: at %ld %s<-%s mode %d/%s:%s keyid %08x len %d auth %d org %#010x.%08x xmt %#010x.%08x MAC\n",
current_time, stoa(dstadr_sin),
stoa(&rbufp->recv_srcadr), hismode, hm_str, am_str,
skeyid, authlen + has_mac, is_authentic,
@@ -1198,6 +1214,8 @@ receive(
* client association; a symmetric active packet mobilizes a
* symmetric passive association.
*/
+ DPRINTF(1, ("receive: MATCH_ASSOC dispatch: mode %d/%s:%s \n",
+ hismode, hm_str, am_str));
switch (retcode) {
/*
@@ -1373,7 +1391,7 @@ receive(
if (NULL == peer) {
DPRINTF(2, ("receive: AM_MANYCAST drop: duplicate\n"));
sys_declined++;
- return; /* ignore duplicate */
+ return; /* ignore duplicate */
}
/*
@@ -1511,10 +1529,10 @@ receive(
* is fixed at this value.
*/
peer = newpeer(&rbufp->recv_srcadr, NULL, match_ep,
- r4a.ippeerlimit, MODE_CLIENT, hisversion,
- pkt->ppoll, pkt->ppoll,
- FLAG_BC_VOL | FLAG_IBURST | FLAG_PREEMPT, MDF_BCLNT,
- 0, skeyid, sys_ident);
+ r4a.ippeerlimit, MODE_CLIENT, hisversion,
+ pkt->ppoll, pkt->ppoll,
+ FLAG_BC_VOL | FLAG_IBURST | FLAG_PREEMPT, MDF_BCLNT,
+ 0, skeyid, sys_ident);
if (NULL == peer) {
DPRINTF(2, ("receive: AM_NEWBCL drop: empty newpeer() failed\n"));
sys_restricted++;
@@ -1529,15 +1547,19 @@ receive(
return; /* hooray */
/*
- * This is the first packet received from a symmetric active
- * peer. If the packet is authentic, the first he sent, and
- * RES_NOEPEER is not enabled, mobilize a passive association
- * If not, kiss the frog.
+ * This is the first packet received from a potential ephemeral
+ * symmetric active peer. First, deal with broken Windows clients.
+ * Then, if NOEPEER is enabled, drop it. If the packet meets our
+ * authenticty requirements and is the first he sent, mobilize
+ * a passive association.
+ * Otherwise, kiss the frog.
*
* There are cases here where we do not call record_raw_stats().
*/
case AM_NEWPASS:
+ DEBUG_REQUIRE(MODE_ACTIVE == hismode);
+
#ifdef AUTOKEY
/*
* Do not respond if not the same group.
@@ -1551,27 +1573,33 @@ receive(
if (!AUTH(sys_authenticate | (restrict_mask &
(RES_NOPEER | RES_DONTTRUST)), is_authentic)
) {
- if (0 == (restrict_mask & RES_NOEPEER)) {
- /*
- * If authenticated but cannot mobilize an
- * association, send a symmetric passive
- * response without mobilizing an association.
- * This is for drat broken Windows clients. See
- * Microsoft KB 875424 for preferred workaround.
- */
- if (AUTH(restrict_mask & RES_DONTTRUST,
- is_authentic)) {
- fast_xmit(rbufp, MODE_PASSIVE, skeyid,
- restrict_mask);
- return; /* hooray */
- }
- if (is_authentic == AUTH_ERROR) {
- fast_xmit(rbufp, MODE_ACTIVE, 0,
- restrict_mask);
- sys_restricted++;
- return;
- }
+ /*
+ * If authenticated but cannot mobilize an
+ * association, send a symmetric passive
+ * response without mobilizing an association.
+ * This is for drat broken Windows clients. See
+ * Microsoft KB 875424 for preferred workaround.
+ */
+ if (AUTH(restrict_mask & RES_DONTTRUST,
+ is_authentic)) {
+ fast_xmit(rbufp, MODE_PASSIVE, skeyid,
+ restrict_mask);
+ return; /* hooray */
}
+ /* HMS: Why is this next set of lines a feature? */
+ if (is_authentic == AUTH_ERROR) {
+ fast_xmit(rbufp, MODE_PASSIVE, 0,
+ restrict_mask);
+ sys_restricted++;
+ return;
+ }
+
+ if (restrict_mask & RES_NOEPEER) {
+ DPRINTF(2, ("receive: AM_NEWPASS drop: NOEPEER\n"));
+ sys_declined++;
+ return;
+ }
+
/* [Bug 2941]
* If we got here, the packet isn't part of an
* existing association, either isn't correctly
@@ -1593,6 +1621,12 @@ receive(
return;
}
+ if (restrict_mask & RES_NOEPEER) {
+ DPRINTF(2, ("receive: AM_NEWPASS drop: NOEPEER\n"));
+ sys_declined++;
+ return;
+ }
+
/*
* Do not respond if synchronized and if stratum is
* below the floor or at or above the ceiling. Note,
@@ -1670,8 +1704,8 @@ receive(
}
/* This is error-worthy */
- if (pkt->ppoll < peer->minpoll ||
- pkt->ppoll > peer->maxpoll ) {
+ if ( pkt->ppoll < peer->minpoll
+ || pkt->ppoll > peer->maxpoll) {
msyslog(LOG_INFO, "receive: broadcast poll of %u from %s is out-of-range (%d to %d)!",
pkt->ppoll, stoa(&rbufp->recv_srcadr),
peer->minpoll, peer->maxpoll);
@@ -1719,7 +1753,7 @@ receive(
* network is trustable, so we take our accepted
* broadcast packets as we receive them. But
* some folks might want to take additional poll
- * delays before believing a backward step.
+ * delays before believing a backward step.
*/
if (sys_bcpollbstep) {
/* pkt->ppoll or peer->ppoll ? */
@@ -1735,8 +1769,8 @@ receive(
tdiff = p_xmt;
L_SUB(&tdiff, &peer->bxmt);
}
- if (tdiff.l_i < 0 &&
- (current_time - peer->timereceived) < deadband)
+ if ( tdiff.l_i < 0
+ && (current_time - peer->timereceived) < deadband)
{
msyslog(LOG_INFO, "receive: broadcast packet from %s contains non-monotonic timestamp: %#010x.%08x -> %#010x.%08x",
stoa(&rbufp->recv_srcadr),
@@ -2431,6 +2465,7 @@ process_packet(
peer->seldisptoolarge++;
DPRINTF(1, ("packet: flash header %04x\n",
peer->flash));
+ poll_update(peer, peer->hpoll); /* ppoll updated? */
return;
}
@@ -2586,7 +2621,7 @@ process_packet(
* between the unicast timestamp and the broadcast
* timestamp. This works for both basic and interleaved
* modes.
- * [Bug 3031] Don't keep this peer when the delay
+ * [Bug 3031] Don't keep this peer when the delay
* calculation gives reason to suspect clock steps.
* This is assumed for delays > 50ms.
*/
@@ -2977,8 +3012,6 @@ poll_update(
} else {
if (peer->retry > 0)
hpoll = peer->minpoll;
- else if (!(peer->reach))
- hpoll = peer->hpoll;
else
hpoll = min(peer->ppoll, peer->hpoll);
#ifdef REFCLOCK
@@ -3072,6 +3105,10 @@ peer_clear(
peer->stratum = STRATUM_UNSPEC;
memcpy(&peer->refid, ident, 4);
#ifdef REFCLOCK
+ } else {
+ /* Clear refclock sample filter */
+ peer->procptr->codeproc = 0;
+ peer->procptr->coderecv = 0;
}
#endif
@@ -3987,7 +4024,7 @@ peer_xmit(
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,
+ stoa(&peer->srcadr), peer->hmode, sendlen,
xmt_tx.l_ui, xmt_tx.l_uf));
return;
}
@@ -4330,7 +4367,7 @@ leap_smear_add_offs(
return;
}
-#endif /* LEAP_SMEAR */
+#endif /* LEAP_SMEAR */
/*
diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c
index a0dbd4ca83b6..d109b7115793 100644
--- a/ntpd/ntp_refclock.c
+++ b/ntpd/ntp_refclock.c
@@ -112,7 +112,7 @@ refclock_report(
/* ignore others */
break;
}
- if (pp->lastevent < 15)
+ if ((code != CEVNT_NOMINAL) && (pp->lastevent < 15))
pp->lastevent++;
if (pp->currentstatus != code) {
pp->currentstatus = (u_char)code;
diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c
index e541f7c51198..19d9b0d829c5 100644
--- a/ntpd/ntp_request.c
+++ b/ntpd/ntp_request.c
@@ -890,6 +890,7 @@ peer_info (
ip->flags |= INFO_FLAG_SHORTLIST;
ip->leap = pp->leap;
ip->hmode = pp->hmode;
+ ip->pmode = pp->pmode;
ip->keyid = pp->keyid;
ip->stratum = pp->stratum;
ip->ppoll = pp->ppoll;
diff --git a/ntpd/ntpd-opts.c b/ntpd/ntpd-opts.c
index 47b080872f6f..82656cf61535 100644
--- a/ntpd/ntpd-opts.c
+++ b/ntpd/ntpd-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
- * It has been AutoGen-ed February 27, 2018 at 05:13:19 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed August 14, 2018 at 08:27:45 AM 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[3132] =
-/* 0 */ "ntpd 4.2.8p11\n"
+/* 0 */ "ntpd 4.2.8p12\n"
"Copyright (C) 1992-2017 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[3132] =
/* 2901 */ "output version information and exit\0"
/* 2937 */ "version\0"
/* 2945 */ "NTPD\0"
-/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p11\n"
+/* 2950 */ "ntpd - NTP daemon program - Ver. 4.2.8p12\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ <server1> ... <serverN> ]\n\0"
/* 3082 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 3116 */ "\n\0"
-/* 3118 */ "ntpd 4.2.8p11";
+/* 3118 */ "ntpd 4.2.8p12";
/**
* ipv4 option description with
@@ -1529,7 +1529,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdOptions.pzCopyright */
- puts(_("ntpd 4.2.8p11\n\
+ puts(_("ntpd 4.2.8p12\n\
Copyright (C) 1992-2017 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.8p11\n\
+ puts(_("ntpd - NTP daemon program - Ver. 4.2.8p12\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.8p11"));
+ puts(_("ntpd 4.2.8p12"));
/* referenced via ntpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/ntpd/ntpd-opts.h b/ntpd/ntpd-opts.h
index 3372d4d8e41b..60299c6bb2cc 100644
--- a/ntpd/ntpd-opts.h
+++ b/ntpd/ntpd-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
- * It has been AutoGen-ed February 27, 2018 at 05:13:17 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed August 14, 2018 at 08:27:44 AM 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.8p11"
+#define NTPD_VERSION "4.2.8p12"
/** Full ntpd version text */
-#define NTPD_FULL_VERSION "ntpd 4.2.8p11"
+#define NTPD_FULL_VERSION "ntpd 4.2.8p12"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/ntpd/ntpd.1ntpdman b/ntpd/ntpd.1ntpdman
index ec02e0c177f9..c9e93181ef43 100644
--- a/ntpd/ntpd.1ntpdman
+++ b/ntpd/ntpd.1ntpdman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd 1ntpdman "27 Feb 2018" "4.2.8p11" "User Commands"
+.TH ntpd 1ntpdman "14 Aug 2018" "4.2.8p12" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Ffa4WQ/ag-RfaWVQ)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jbaWTB/ag-ubaOSB)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:30 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:02 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/ntpd/ntpd.1ntpdmdoc b/ntpd/ntpd.1ntpdmdoc
index 339d2cff04a2..33a90324810d 100644
--- a/ntpd/ntpd.1ntpdmdoc
+++ b/ntpd/ntpd.1ntpdmdoc
@@ -1,9 +1,9 @@
-.Dd February 27 2018
+.Dd August 14 2018
.Dt NTPD 1ntpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:47 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:20 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c
index d4204efd8d39..b477a71804bf 100644
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -104,6 +104,10 @@
#endif
#endif
+#ifdef SYS_WINNT
+# include "ntservice.h"
+#endif
+
#ifdef _AIX
# include <ulimit.h>
#endif /* _AIX */
@@ -123,6 +127,9 @@
#if defined(HAVE_PRIV_H) && defined(HAVE_SOLARIS_PRIVS)
# include <priv.h>
#endif /* HAVE_PRIV_H */
+#if defined(HAVE_TRUSTEDBSD_MAC)
+# include <sys/mac.h>
+#endif /* HAVE_TRUSTEDBSD_MAC */
#endif /* HAVE_DROPROOT */
#if defined (LIBSECCOMP) && (KERN_SECCOMP)
@@ -182,7 +189,6 @@ char *group; /* group to switch to */
const char *chrootdir; /* directory to chroot to */
uid_t sw_uid;
gid_t sw_gid;
-char *endp;
struct group *gr;
struct passwd *pw;
#endif /* HAVE_DROPROOT */
@@ -523,6 +529,219 @@ set_process_priority(void)
}
#endif /* !SIM */
+#if !defined(SIM) && !defined(SYS_WINNT)
+/*
+ * Detach from terminal (much like daemon())
+ * Nothe that this function calls exit()
+ */
+static void
+detach_from_terminal(
+ int pipe_fds[2],
+ long wait_sync,
+ const char *logfilename
+ )
+{
+ int rc;
+ int exit_code;
+# if !defined(HAVE_SETSID) && !defined (HAVE_SETPGID) && defined(TIOCNOTTY)
+ int fid;
+# endif
+# ifdef _AIX
+ struct sigaction sa;
+# endif
+
+ rc = fork();
+ if (-1 == rc) {
+ exit_code = (errno) ? errno : -1;
+ msyslog(LOG_ERR, "fork: %m");
+ exit(exit_code);
+ }
+ if (rc > 0) {
+ /* parent */
+ exit_code = wait_child_sync_if(pipe_fds[0],
+ wait_sync);
+ exit(exit_code);
+ }
+
+ /*
+ * child/daemon
+ * close all open files excepting waitsync_fd_to_close.
+ * msyslog() unreliable until after init_logging().
+ */
+ closelog();
+ if (syslog_file != NULL) {
+ fclose(syslog_file);
+ syslog_file = NULL;
+ syslogit = TRUE;
+ }
+ close_all_except(waitsync_fd_to_close);
+ INSIST(0 == open("/dev/null", 0) && 1 == dup2(0, 1) \
+ && 2 == dup2(0, 2));
+
+ init_logging(progname, 0, TRUE);
+ /* we lost our logfile (if any) daemonizing */
+ setup_logfile(logfilename);
+
+# ifdef SYS_DOMAINOS
+ {
+ uid_$t puid;
+ status_$t st;
+
+ proc2_$who_am_i(&puid);
+ proc2_$make_server(&puid, &st);
+ }
+# endif /* SYS_DOMAINOS */
+# ifdef HAVE_SETSID
+ if (setsid() == (pid_t)-1)
+ msyslog(LOG_ERR, "setsid(): %m");
+# elif defined(HAVE_SETPGID)
+ if (setpgid(0, 0) == -1)
+ msyslog(LOG_ERR, "setpgid(): %m");
+# else /* !HAVE_SETSID && !HAVE_SETPGID follows */
+# ifdef TIOCNOTTY
+ fid = open("/dev/tty", 2);
+ if (fid >= 0) {
+ ioctl(fid, (u_long)TIOCNOTTY, NULL);
+ close(fid);
+ }
+# endif /* TIOCNOTTY */
+ ntp_setpgrp(0, getpid());
+# endif /* !HAVE_SETSID && !HAVE_SETPGID */
+# ifdef _AIX
+ /* Don't get killed by low-on-memory signal. */
+ sa.sa_handler = catch_danger;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_RESTART;
+ sigaction(SIGDANGER, &sa, NULL);
+# endif /* _AIX */
+
+ return;
+}
+
+#ifdef HAVE_DROPROOT
+/*
+ * Map user name/number to user ID
+*/
+static int
+map_user(
+ )
+{
+ char *endp;
+
+ if (isdigit((unsigned char)*user)) {
+ sw_uid = (uid_t)strtoul(user, &endp, 0);
+ if (*endp != '\0')
+ goto getuser;
+
+ if ((pw = getpwuid(sw_uid)) != NULL) {
+ free(user);
+ user = estrdup(pw->pw_name);
+ sw_gid = pw->pw_gid;
+ } else {
+ errno = 0;
+ msyslog(LOG_ERR, "Cannot find user ID %s", user);
+ return 0;
+ }
+
+ } else {
+getuser:
+ errno = 0;
+ if ((pw = getpwnam(user)) != NULL) {
+ sw_uid = pw->pw_uid;
+ sw_gid = pw->pw_gid;
+ } else {
+ if (errno)
+ msyslog(LOG_ERR, "getpwnam(%s) failed: %m", user);
+ else
+ msyslog(LOG_ERR, "Cannot find user `%s'", user);
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * Map group name/number to group ID
+*/
+static int
+map_group(
+ )
+{
+ char *endp;
+
+ if (isdigit((unsigned char)*group)) {
+ sw_gid = (gid_t)strtoul(group, &endp, 0);
+ if (*endp != '\0')
+ goto getgroup;
+ } else {
+getgroup:
+ if ((gr = getgrnam(group)) != NULL) {
+ sw_gid = gr->gr_gid;
+ } else {
+ errno = 0;
+ msyslog(LOG_ERR, "Cannot find group `%s'", group);
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * Change (effective) user and group IDs, also initialize the supplementary group access list
+ */
+int
+set_user_group_ids(
+ )
+{
+ /* If the the user was already mapped, no need to map it again */
+ if ((NULL != user) && (0 == sw_uid)) {
+ if (0 == map_user())
+ exit (-1);
+ }
+ /* same applies for the group */
+ if ((NULL != group) && (0 == sw_gid)) {
+ if (0 == map_group())
+ exit (-1);
+ }
+
+ if (user && initgroups(user, sw_gid)) {
+ msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user);
+ return 0;
+ }
+ if (group && setgid(sw_gid)) {
+ msyslog(LOG_ERR, "Cannot setgid() to group `%s': %m", group);
+ return 0;
+ }
+ if (group && setegid(sw_gid)) {
+ msyslog(LOG_ERR, "Cannot setegid() to group `%s': %m", group);
+ return 0;
+ }
+ if (group) {
+ if (0 != setgroups(1, &sw_gid)) {
+ msyslog(LOG_ERR, "setgroups(1, %d) failed: %m", sw_gid);
+ return 0;
+ }
+ }
+ else if (pw)
+ if (0 != initgroups(pw->pw_name, pw->pw_gid)) {
+ msyslog(LOG_ERR, "initgroups(<%s>, %d) filed: %m", pw->pw_name, pw->pw_gid);
+ return 0;
+ }
+ if (user && setuid(sw_uid)) {
+ msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
+ return 0;
+ }
+ if (user && seteuid(sw_uid)) {
+ msyslog(LOG_ERR, "Cannot seteuid() to user `%s': %m", user);
+ return 0;
+ }
+
+ return 1;
+}
+#endif /* HAVE_DROPROOT */
+#endif /* !SIM */
/*
* Main program. Initialize us, disconnect us from the tty if necessary,
@@ -549,12 +768,6 @@ ntpdmain(
int pipe_fds[2];
int rc;
int exit_code;
-# ifdef _AIX
- struct sigaction sa;
-# endif
-# if !defined(HAVE_SETSID) && !defined (HAVE_SETPGID) && defined(TIOCNOTTY)
- int fid;
-# endif
# endif /* HAVE_WORKING_FORK*/
# ifdef SCO5_CLOCK
int fd;
@@ -634,7 +847,12 @@ ntpdmain(
/* MPE lacks the concept of root */
# if defined(HAVE_GETUID) && !defined(MPE)
uid = getuid();
- if (uid && !HAVE_OPT( SAVECONFIGQUIT )) {
+ if (uid && !HAVE_OPT( SAVECONFIGQUIT )
+# if defined(HAVE_TRUSTEDBSD_MAC)
+ /* We can run as non-root if the mac_ntpd policy is enabled. */
+ && mac_is_present("ntpd") != 1
+# endif
+ ) {
msyslog_term = TRUE;
msyslog(LOG_ERR,
"must be run as root, not uid %ld", (long)uid);
@@ -718,6 +936,11 @@ ntpdmain(
init_lib();
# ifdef SYS_WINNT
/*
+ * Make sure the service is initialized before we do anything else
+ */
+ ntservice_init();
+
+ /*
* Start interpolation thread, must occur before first
* get_systime()
*/
@@ -736,70 +959,7 @@ ntpdmain(
if (!nofork) {
# ifdef HAVE_WORKING_FORK
- rc = fork();
- if (-1 == rc) {
- exit_code = (errno) ? errno : -1;
- msyslog(LOG_ERR, "fork: %m");
- exit(exit_code);
- }
- if (rc > 0) {
- /* parent */
- exit_code = wait_child_sync_if(pipe_fds[0],
- wait_sync);
- exit(exit_code);
- }
-
- /*
- * child/daemon
- * close all open files excepting waitsync_fd_to_close.
- * msyslog() unreliable until after init_logging().
- */
- closelog();
- if (syslog_file != NULL) {
- fclose(syslog_file);
- syslog_file = NULL;
- syslogit = TRUE;
- }
- close_all_except(waitsync_fd_to_close);
- INSIST(0 == open("/dev/null", 0) && 1 == dup2(0, 1) \
- && 2 == dup2(0, 2));
-
- init_logging(progname, 0, TRUE);
- /* we lost our logfile (if any) daemonizing */
- setup_logfile(logfilename);
-
-# ifdef SYS_DOMAINOS
- {
- uid_$t puid;
- status_$t st;
-
- proc2_$who_am_i(&puid);
- proc2_$make_server(&puid, &st);
- }
-# endif /* SYS_DOMAINOS */
-# ifdef HAVE_SETSID
- if (setsid() == (pid_t)-1)
- msyslog(LOG_ERR, "setsid(): %m");
-# elif defined(HAVE_SETPGID)
- if (setpgid(0, 0) == -1)
- msyslog(LOG_ERR, "setpgid(): %m");
-# else /* !HAVE_SETSID && !HAVE_SETPGID follows */
-# ifdef TIOCNOTTY
- fid = open("/dev/tty", 2);
- if (fid >= 0) {
- ioctl(fid, (u_long)TIOCNOTTY, NULL);
- close(fid);
- }
-# endif /* TIOCNOTTY */
- ntp_setpgrp(0, getpid());
-# endif /* !HAVE_SETSID && !HAVE_SETPGID */
-# ifdef _AIX
- /* Don't get killed by low-on-memory signal. */
- sa.sa_handler = catch_danger;
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_RESTART;
- sigaction(SIGDANGER, &sa, NULL);
-# endif /* _AIX */
+ detach_from_terminal(pipe_fds, wait_sync, logfilename);
# endif /* HAVE_WORKING_FORK */
}
@@ -972,51 +1132,12 @@ ntpdmain(
# endif /* HAVE_LINUX_CAPABILITIES || HAVE_SOLARIS_PRIVS */
if (user != NULL) {
- if (isdigit((unsigned char)*user)) {
- sw_uid = (uid_t)strtoul(user, &endp, 0);
- if (*endp != '\0')
- goto getuser;
-
- if ((pw = getpwuid(sw_uid)) != NULL) {
- free(user);
- user = estrdup(pw->pw_name);
- sw_gid = pw->pw_gid;
- } else {
- errno = 0;
- msyslog(LOG_ERR, "Cannot find user ID %s", user);
- exit (-1);
- }
-
- } else {
-getuser:
- errno = 0;
- if ((pw = getpwnam(user)) != NULL) {
- sw_uid = pw->pw_uid;
- sw_gid = pw->pw_gid;
- } else {
- if (errno)
- msyslog(LOG_ERR, "getpwnam(%s) failed: %m", user);
- else
- msyslog(LOG_ERR, "Cannot find user `%s'", user);
- exit (-1);
- }
- }
+ if (0 == map_user())
+ exit (-1);
}
if (group != NULL) {
- if (isdigit((unsigned char)*group)) {
- sw_gid = (gid_t)strtoul(group, &endp, 0);
- if (*endp != '\0')
- goto getgroup;
- } else {
-getgroup:
- if ((gr = getgrnam(group)) != NULL) {
- sw_gid = gr->gr_gid;
- } else {
- errno = 0;
- msyslog(LOG_ERR, "Cannot find group `%s'", group);
- exit (-1);
- }
- }
+ if (0 == map_group())
+ exit (-1);
}
if (chrootdir ) {
@@ -1050,39 +1171,20 @@ getgroup:
exit(-1);
}
# endif /* HAVE_SOLARIS_PRIVS */
- if (user && initgroups(user, sw_gid)) {
- msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user);
- exit (-1);
- }
- if (group && setgid(sw_gid)) {
- msyslog(LOG_ERR, "Cannot setgid() to group `%s': %m", group);
- exit (-1);
- }
- if (group && setegid(sw_gid)) {
- msyslog(LOG_ERR, "Cannot setegid() to group `%s': %m", group);
- exit (-1);
- }
- if (group) {
- if (0 != setgroups(1, &sw_gid)) {
- msyslog(LOG_ERR, "setgroups(1, %d) failed: %m", sw_gid);
- exit (-1);
- }
- }
- else if (pw)
- if (0 != initgroups(pw->pw_name, pw->pw_gid)) {
- msyslog(LOG_ERR, "initgroups(<%s>, %d) filed: %m", pw->pw_name, pw->pw_gid);
- exit (-1);
- }
- if (user && setuid(sw_uid)) {
- msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
- exit (-1);
- }
- if (user && seteuid(sw_uid)) {
- msyslog(LOG_ERR, "Cannot seteuid() to user `%s': %m", user);
+ if (0 == set_user_group_ids())
+ exit(-1);
+
+# if defined(HAVE_TRUSTEDBSD_MAC)
+ /*
+ * To manipulate system time and (re-)bind to NTP_PORT as needed
+ * following interface changes, we must either run as uid 0 or
+ * the mac_ntpd policy module must be enabled.
+ */
+ if (sw_uid != 0 && mac_is_present("ntpd") != 1) {
+ msyslog(LOG_ERR, "Need MAC 'ntpd' policy enabled to drop root privileges");
exit (-1);
}
-
-# if !defined(HAVE_LINUX_CAPABILITIES) && !defined(HAVE_SOLARIS_PRIVS)
+# elif !defined(HAVE_LINUX_CAPABILITIES) && !defined(HAVE_SOLARIS_PRIVS)
/*
* for now assume that the privilege to bind to privileged ports
* is associated with running with uid 0 - should be refined on
@@ -1245,6 +1347,10 @@ int scmp_sc[] = {
}
#endif /* LIBSECCOMP and KERN_SECCOMP */
+#ifdef SYS_WINNT
+ ntservice_isup();
+#endif
+
# ifdef HAVE_IO_COMPLETION_PORT
for (;;) {
diff --git a/ntpd/ntpd.html b/ntpd/ntpd.html
index 3af0cc546bbf..64198eff79a1 100644
--- a/ntpd/ntpd.html
+++ b/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.8p11 of <code>ntpd</code>.
+ <p>This document applies to version 4.2.8p12 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.8p10
+<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p11
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/ntpd/ntpd.man.in b/ntpd/ntpd.man.in
index d3f94c65409b..c32ceb3c8f7f 100644
--- a/ntpd/ntpd.man.in
+++ b/ntpd/ntpd.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd @NTPD_MS@ "27 Feb 2018" "4.2.8p11" "User Commands"
+.TH ntpd @NTPD_MS@ "14 Aug 2018" "4.2.8p12" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Ffa4WQ/ag-RfaWVQ)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-jbaWTB/ag-ubaOSB)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:30 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:02 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/ntpd/ntpd.mdoc.in b/ntpd/ntpd.mdoc.in
index 53b1f4176a14..a9383b128d6a 100644
--- a/ntpd/ntpd.mdoc.in
+++ b/ntpd/ntpd.mdoc.in
@@ -1,9 +1,9 @@
-.Dd February 27 2018
+.Dd August 14 2018
.Dt NTPD @NTPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed February 27, 2018 at 05:14:47 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed August 14, 2018 at 08:29:20 AM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/ntpd/rc_cmdlength.c b/ntpd/rc_cmdlength.c
index 922312e62a7b..240fa0afbbdd 100644
--- a/ntpd/rc_cmdlength.c
+++ b/ntpd/rc_cmdlength.c
@@ -5,6 +5,8 @@
# include <unistd.h>
#endif
+// XXX: Move to header.
+size_t remoteconfig_cmdlength( const char *, const char *);
/* Bug 2853 */
/* evaluate the length of the command sequence. This breaks at the first
diff --git a/ntpd/refclock_datum.c b/ntpd/refclock_datum.c
index 9795cfadaab2..09d72c6af492 100644
--- a/ntpd/refclock_datum.c
+++ b/ntpd/refclock_datum.c
@@ -485,7 +485,8 @@ datum_pts_receive(
struct recvbuf *rbufp
)
{
- int i, nb;
+ int i;
+ size_t nb;
l_fp tstmp;
struct peer *p;
struct datum_pts_unit *datum_pts;
diff --git a/ntpd/refclock_gpsdjson.c b/ntpd/refclock_gpsdjson.c
index c2d41ff07f17..78a4fc82fcc9 100644
--- a/ntpd/refclock_gpsdjson.c
+++ b/ntpd/refclock_gpsdjson.c
@@ -1136,7 +1136,7 @@ json_token_skip(
const json_ctx * ctx,
tok_ref tid)
{
- if (tid >= 0 && (u_int)tid < ctx->ntok) {
+ if (tid >= 0 && tid < ctx->ntok) {
int len = ctx->tok[tid].size;
/* For arrays and objects, the size is the number of
* ITEMS in the compound. Thats the number of objects in
@@ -1164,7 +1164,7 @@ json_token_skip(
/* The next condition should never be true, but paranoia
* prevails...
*/
- if (tid < 0 || (u_int)tid > ctx->ntok)
+ if (tid < 0 || tid > ctx->ntok)
tid = ctx->ntok;
}
return tid;
diff --git a/ntpd/refclock_jupiter.c b/ntpd/refclock_jupiter.c
index 84d089d2dd45..dbed272467ed 100644
--- a/ntpd/refclock_jupiter.c
+++ b/ntpd/refclock_jupiter.c
@@ -139,8 +139,7 @@ static void jupiter_canmsg (struct instance *, u_int);
static u_short jupiter_cksum (u_short *, u_int);
static int jupiter_config (struct instance *);
static void jupiter_debug (struct peer *, const char *,
- const char *, ...)
- __attribute__ ((format (printf, 3, 4)));
+ const char *, ...) NTP_PRINTF(3, 4);
static const char * jupiter_parse_t (struct instance *, u_short *);
static const char * jupiter_parse_gpos (struct instance *, u_short *);
static void jupiter_platform (struct instance *, u_int);
diff --git a/ntpd/refclock_shm.c b/ntpd/refclock_shm.c
index f031a395cb99..da38355b4c21 100644
--- a/ntpd/refclock_shm.c
+++ b/ntpd/refclock_shm.c
@@ -340,6 +340,7 @@ shm_poll(
if (pp->coderecv != pp->codeproc) {
/* have some samples, everything OK */
pp->lastref = pp->lastrec;
+ refclock_report(peer, CEVNT_NOMINAL);
refclock_receive(peer);
} else if (NULL == up->shm) { /* is this possible at all? */
/* we're out of business without SHM access */
diff --git a/ntpd/refclock_true.c b/ntpd/refclock_true.c
index 2799f3ee5dee..35901392da0e 100644
--- a/ntpd/refclock_true.c
+++ b/ntpd/refclock_true.c
@@ -640,7 +640,7 @@ true_send(
size_t len = strlen(cmd);
true_debug(peer, "Send '%s'\n", cmd);
- if (write(pp->io.fd, cmd, (unsigned)len) != len)
+ if (write(pp->io.fd, cmd, len) != (ssize_t)len)
refclock_report(peer, CEVNT_FAULT);
else
pp->polls++;