OpenBSD CVS

CVS log for src/usr.sbin/ntpd/parse.y


[BACK] Up to [local] / src / usr.sbin / ntpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.78 / (download) - annotate - [select for diffs], Fri Oct 15 15:01:28 2021 UTC (2 years, 7 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.77: +13 -13 lines
Diff to previous 1.77 (colored)

Don't declare variables as "unsigned char *" that are passed to
functions that take "char *" arguments.  Where such chars are
assigned to int or passed to ctype functions, explicitly cast them
to unsigned char.

For OpenBSD's clang, -Wpointer-sign has been disabled by default,
but when the parse.y code was built elsewhere, the compiler would
complain.

With help from millert@
ok benno@ deraadt@

Revision 1.77 / (download) - annotate - [select for diffs], Sat Apr 11 07:49:48 2020 UTC (4 years, 1 month ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.76: +1 -2 lines
Diff to previous 1.76 (colored)

Zap double definition of conf and make ibuf_dns static to avoid double
definition; from Michael Forney

Revision 1.76 / (download) - annotate - [select for diffs], Mon Nov 11 06:32:52 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.75: +9 -2 lines
Diff to previous 1.75 (colored)

Also implement "trusted" for sensors; do not do constraint validation
for these. ok deraadt@

Revision 1.75 / (download) - annotate - [select for diffs], Sun Nov 10 19:24:47 2019 UTC (4 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.74: +13 -2 lines
Diff to previous 1.74 (colored)

Introduce a "trusted" modifier, for peers that should be on a local net
used in situations where https constraints cannot be used and we still want
auto settime. Result of discussion with and ok deraadt@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Nov 6 13:35:25 2019 UTC (4 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.73: +33 -3 lines
Diff to previous 1.73 (colored)

Allow the singular constraint clause to list multiple addresses;
ok deraadt@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Jul 16 14:15:40 2019 UTC (4 years, 10 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.72: +4 -3 lines
Diff to previous 1.72 (colored)

1) Re-resolve and re-get constraints once the clock is synced. Constraints
are relative to monotime; so they shift when time is being adjusted.
2) Fix a race between SIGCHLD delivery and reading the result imsg.
3) Some cleanup: use a number to distinguish pools internally

Revision 1.72 / (download) - annotate - [select for diffs], Wed Jun 12 05:04:45 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Fix init of syslog for childs and teach dns process about synced state.
ok benno@

Revision 1.71 / (download) - annotate - [select for diffs], Wed Feb 13 22:57:08 2019 UTC (5 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored)

(unsigned) means (unsigned int) which on ptrdiff_t or size_t or other
larger types really is a range reduction...
Almost any cast to (unsigned) is a bug.
ok millert tb benno

Revision 1.70 / (download) - annotate - [select for diffs], Thu Nov 1 00:18:44 2018 UTC (5 years, 7 months ago) by sashan
Branch: MAIN
Changes since 1.69: +3 -2 lines
Diff to previous 1.69 (colored)

- odd condition/test in PF lexer
  (and other lexers too)

This commit rectifies earlier change:

    in the lex... even inside quotes, a \ followed by space or tab should
    expand to space or tab, and a \ followed by newline should be ignored
    (as a line continuation).  compatible with the needs of hoststated
    (which has the most strict quoted string requirements), and ifstated
    (where one commonly does line continuations in strings).

OK deraadt@, OK millert@

Revision 1.69 / (download) - annotate - [select for diffs], Mon Jul 9 12:05:11 2018 UTC (5 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored)

No need to mention which memory allocation entry point failed (malloc,
calloc or strdup), we just need to log that we ran out of memory in a
particular function.

Recommended by florian@ and deraadt@

ok benno@ henning@ tb@

Revision 1.68 / (download) - annotate - [select for diffs], Sun Jul 8 17:15:07 2018 UTC (5 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored)

Be consistent in warn() and log_warn() usage when
running out of memory.

Next step, be correct *and* consistent.

ok dennis@ tb@ benno@ schwarze@

Revision 1.67 / (download) - annotate - [select for diffs], Fri Aug 11 19:12:21 2017 UTC (6 years, 9 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.66: +3 -1 lines
Diff to previous 1.66 (colored)

zero out sockaddr_in before use; fixes use of stack garbage as port number
in "query from"; ok phessler@ job@

Revision 1.66 / (download) - annotate - [select for diffs], Tue May 30 23:30:48 2017 UTC (7 years ago) by benno
Branch: MAIN
Changes since 1.65: +31 -2 lines
Diff to previous 1.65 (colored)

add option "query from <ip>" to ntpd.conf, to specify a local IP
address for outgoing ntp queries.
From Job Snijders, thanks!
with feedback and ok henning@

Revision 1.65 / (download) - annotate - [select for diffs], Sat Oct 31 19:32:18 2015 UTC (8 years, 7 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.64: +3 -6 lines
Diff to previous 1.64 (colored)

fully revert some parts introduced with the original server rtable support,
so servers with numeric IP addresses won't be skipped; ok reyk@

Revision 1.64 / (download) - annotate - [select for diffs], Fri Oct 23 14:52:20 2015 UTC (8 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.63: +3 -9 lines
Diff to previous 1.63 (colored)

Allowing upstream servers of ntp being in multiple routing tables is
non-sensical.  The dns lookups happened in the process routing table
(usually '0'), which is very likely to have different results from the
other routing domains.  If you do depend on having this behaviour,
you'll need to use pf to cross the rtable boundary.

"listen on * rtable X" is still supported.

Users of "server * rtable X" will need to switch to launching ntpd with
"route -T X exec /usr/sbin/ntpd"

OK deraadt@

Revision 1.63 / (download) - annotate - [select for diffs], Sat Jul 18 00:53:44 2015 UTC (8 years, 10 months ago) by bcook
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

replace bzero with memset

ok phessler@ deraadt@

Revision 1.62 / (download) - annotate - [select for diffs], Sun May 17 18:31:32 2015 UTC (9 years ago) by reyk
Branch: MAIN
Changes since 1.61: +7 -7 lines
Diff to previous 1.61 (colored)

When resolving the "constraint" (singular), store all returned IP
addresses and try one after another until the connection succeeded -
based on the existing mechanism of "server".  "constraint" previously
only tried to connect to the first returned address, aborted and
skipped the constraint on failure.  In difference to "constraints"
(plural), it still only connects to one address at a time and not to
all of them at once.

Pointed out by rpe@
OK rpe@ deraadt@

Revision 1.61 / (download) - annotate - [select for diffs], Thu Feb 12 23:07:52 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.60: +9 -8 lines
Diff to previous 1.60 (colored)

Allow constraints URL without leading path (eg. "https://www.openbsd.org").
Fixes segfault on configuration load time, as reported by Donovan Watteau.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Feb 12 01:54:57 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.59: +4 -15 lines
Diff to previous 1.59 (colored)

Use ntpd's deferred DNS resolving for constraints as well.  This
allows to get constraint addresses even if network/DNS is not
available at startup (or system boot).

thumbs up & OK henning@

Revision 1.59 / (download) - annotate - [select for diffs], Tue Feb 10 11:46:39 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.58: +3 -2 lines
Diff to previous 1.58 (colored)

spacing

Revision 1.58 / (download) - annotate - [select for diffs], Tue Feb 10 06:40:08 2015 UTC (9 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.57: +122 -3 lines
Diff to previous 1.57 (colored)

Add support for "constraints": when configured, ntpd(8) will query the
time from HTTPS servers, by parsing the Date: header, and use the
median constraint time as a boundary to verify NTP responses.  This
adds some level of authentication and protection against MITM attacks
while preserving the accuracy of the NTP protocol; without relying on
authentication options for NTP that are basically unavailable at
present.  This is an initial implementation and the semantics will be
improved once it is in the tree.

Discussed with deraadt@ and henning@
OK henning@

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jan 10 13:47:05 2015 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.56: +2 -8 lines
Diff to previous 1.56 (colored)

don't check for a return value that host() doesn't return, so future
generations don't try to change any of the values and break the code.
ok deraadt

Revision 1.56 / (download) - annotate - [select for diffs], Thu Jan 8 00:30:08 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

sync log.c from smtpd.

Reduces the number of log.c snowflakes by a little, and gives ntpd a
variadic fatal() function to be used later.

ok deraadt@

Revision 1.55 / (download) - annotate - [select for diffs], Thu Nov 20 05:51:20 2014 UTC (9 years, 6 months ago) by jsg
Branch: MAIN
Changes since 1.54: +4 -1 lines
Diff to previous 1.54 (colored)

Don't allow embedded nul characters in strings.
Fixes a pfctl crash with an anchor name containing
an embedded nul found with the afl fuzzer.

pfctl parse.y patch from and ok deraadt@

Revision 1.54 / (download) - annotate - [select for diffs], Fri Nov 14 03:20:37 2014 UTC (9 years, 6 months ago) by doug
Branch: MAIN
Changes since 1.53: +4 -2 lines
Diff to previous 1.53 (colored)

Add gcc printf format attributes to yyerror() in parse.y files.
No yyerror() calls needed to be changed.

ok bluhm@

Revision 1.53 / (download) - annotate - [select for diffs], Mon Nov 3 20:15:31 2014 UTC (9 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.52: +6 -6 lines
Diff to previous 1.52 (colored)

Convert the logic in yyerror().  Instead of creating a temporary
format string, create a temporary message.
OK claudio@

Revision 1.52 / (download) - annotate - [select for diffs], Mon Nov 25 12:58:42 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.51: +6 -6 lines
Diff to previous 1.51 (colored)

use u_char for buffers in yylex, for ctype calls
found by millert@, ok deraadt@

Revision 1.51 / (download) - annotate - [select for diffs], Mon Oct 21 08:48:22 2013 UTC (10 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.50: +3 -5 lines
Diff to previous 1.50 (colored)

remove the IPv4-only check for rdomains, allows IPv6 to use them

OK claudio@ henning@

Revision 1.50 / (download) - annotate - [select for diffs], Thu Sep 20 12:43:16 2012 UTC (11 years, 8 months ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.49: +18 -2 lines
Diff to previous 1.49 (colored)

Allow ntpd.conf to assign a stratum to a sensor with the syntax stratum <level>.

OK markus@ henning@ phessler@ jmc@

Revision 1.49 / (download) - annotate - [select for diffs], Wed Dec 28 19:32:34 2011 UTC (12 years, 5 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.48: +4 -2 lines
Diff to previous 1.48 (colored)

only add the rdomain for hostname lookups, when we have a hostname to lookup.

noticed by zepard at gmail

OK henning@

Revision 1.48 / (download) - annotate - [select for diffs], Wed Sep 21 15:41:30 2011 UTC (12 years, 8 months ago) by phessler
Branch: MAIN
Changes since 1.47: +38 -12 lines
Diff to previous 1.47 (colored)

Add rdomain support to NTPd.

This basically adds the "rtable %d" keyword to "listen on", "server",
"servers" keywords, to specify which routing table to use.

OK henning@ claudio@ sthen@
manpage reviewed by jmc@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Aug 3 18:42:40 2010 UTC (13 years, 10 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.46: +4 -3 lines
Diff to previous 1.46 (colored)

fix linecount bug with comments spanning multiple lines
problem reported with the obvious fix for bgpd by Sebastian Benoit
<benoit-lists at fb12.de>, also PR 6432
applied to all the others by yours truly. ok theo
isn't it amazing how far this parser (and more) spread?

Revision 1.46 / (download) - annotate - [select for diffs], Tue Mar 31 21:03:48 2009 UTC (15 years, 2 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.45: +7 -3 lines
Diff to previous 1.45 (colored)

Fixed memory leaks which would occur if the second of two memory
allocations fails.

looks right deraadt, krw
ok henning

Revision 1.45 / (download) - annotate - [select for diffs], Fri Oct 17 14:32:47 2008 UTC (15 years, 7 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.44: +5 -3 lines
Diff to previous 1.44 (colored)

bring in findeol() fix from pfctl

Revision 1.44 / (download) - annotate - [select for diffs], Mon Jun 9 18:26:35 2008 UTC (16 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.43: +5 -5 lines
Diff to previous 1.43 (colored)

do not leak memory on failure in refid production; ok ckuethe henning

Revision 1.43 / (download) - annotate - [select for diffs], Mon Jun 9 16:37:35 2008 UTC (16 years ago) by ckuethe
Branch: MAIN
Changes since 1.42: +19 -2 lines
Diff to previous 1.42 (colored)

Allow outgoing replies from sensor-driven servers to have a
user-configurable reference ID, eg. "GPS" or "DCF"...
ok mbalmer

Revision 1.42 / (download) - annotate - [select for diffs], Tue Feb 26 10:09:58 2008 UTC (16 years, 3 months ago) by mpf
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.41: +15 -14 lines
Diff to previous 1.41 (colored)

Have popfile() also close the main config file,
but only do the final popfile call after yyparse() is done.
This also fixes config reload on SIGHUP for some daemons.

Spotted by otto@. OK deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Nov 12 23:59:41 2007 UTC (16 years, 7 months ago) by mpf
Branch: MAIN
Changes since 1.40: +2 -10 lines
Diff to previous 1.40 (colored)

Remove space/tab compression function from lgetc() and replace
it with a simple filter in the yylex() loop.
The compression in lgetc() didn't happen for quoted strings,
thus creating a regression when tabs were used in variables.
Some testing by todd@ and pyr@
OK deraadt@

Revision 1.40 / (download) - annotate - [select for diffs], Sat Oct 20 14:24:02 2007 UTC (16 years, 7 months ago) by pyr
Branch: MAIN
Changes since 1.39: +5 -3 lines
Diff to previous 1.39 (colored)

ntpd and bgpd's turn to behave like the others.
ok henning@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Oct 16 20:01:23 2007 UTC (16 years, 7 months ago) by mpf
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Allow '=' to end a number in all lexers.
Requested and OK deraadt@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 16 06:06:49 2007 UTC (16 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.37: +4 -2 lines
Diff to previous 1.37 (colored)

in the lex... even inside quotes, a \ followed by space or tab should
expand to space or tab, and a \ followed by newline should be ignored
(as a line continuation).  compatible with the needs of hoststated
(which has the most strict quoted string requirements), and ifstated
(where one commonly does line continuations in strings).
pointed out by mpf, discussed with pyr

Revision 1.37 / (download) - annotate - [select for diffs], Sat Oct 13 16:35:21 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.36: +98 -49 lines
Diff to previous 1.36 (colored)

in all these programs using the same pfctl-derived parse.y, re-unify the
yylex implementation and the code which interacts with yylex.  this also
brings the future potential for include support to all of the parsers.
in the future please do not silly modifications to one of these files
without checking if you are de-unifying the code.
checked by developers in all these areas.

Revision 1.36 / (download) - annotate - [select for diffs], Thu Oct 11 14:39:17 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.35: +26 -14 lines
Diff to previous 1.35 (colored)

next step in the yylex unification: handle quoted strings in a nicer fashion
as found in hoststated, and make all the code diff as clean as possible. a
few issues remain mostly surrounding include support, which will likely be
added to more of the grammers soon.
ok norby pyr, others

Revision 1.35 / (download) - annotate - [select for diffs], Fri Sep 14 06:29:54 2007 UTC (16 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +13 -5 lines
Diff to previous 1.34 (colored)

use a setup function for options, cleaner; ok cloder

Revision 1.34 / (download) - annotate - [select for diffs], Fri Sep 14 03:07:11 2007 UTC (16 years, 8 months ago) by ckuethe
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Correctly assign a default weight of 1 to sensors and servers.
ok beck

Revision 1.33 / (download) - annotate - [select for diffs], Wed Sep 12 21:08:46 2007 UTC (16 years, 9 months ago) by ckuethe
Branch: MAIN
Changes since 1.32: +18 -3 lines
Diff to previous 1.32 (colored)


Add a knob to compensate for a refclock that is early or late. Based on a
diff from Maurice Janssen. Manpage help from jmc and Maurice, other nits
from deraadt and otto.
ok deraadt, otto

Revision 1.32 / (download) - annotate - [select for diffs], Wed Sep 12 18:32:54 2007 UTC (16 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

default weight has to remain 1; seen by Maurice Janssen

Revision 1.31 / (download) - annotate - [select for diffs], Tue Sep 11 23:33:37 2007 UTC (16 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +74 -24 lines
Diff to previous 1.30 (colored)

this is where it all started, since future ntpd.conf commands will require
negative parameters.  extend lex to spot numbers in the stream.  as well,
make it easier to add parameters on command line in any order later
ok otto ckuethe

Revision 1.30 / (download) - annotate - [select for diffs], Tue Oct 3 00:49:09 2006 UTC (17 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

strtonum() with INT_MAX intead of LONG_MAX, problem pointed out by pierre-yves@spootnik.org

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jun 1 06:06:59 2006 UTC (18 years ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.28: +3 -2 lines
Diff to previous 1.28 (colored)

even though the bounds are long long having an upper bound of
ULONG_MAX does not work; the max upper bound is LONG_MAX,
since LONG_MAX == LLONG_MAX on 64bit archs. ok deraadt@ henning@

Revision 1.28 / (download) - annotate - [select for diffs], Sun May 28 20:39:16 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.27: +36 -6 lines
Diff to previous 1.27 (colored)

allow for weight to be added to sensors or servers, so that one can
weight timedelta sensors higher than ntp peers, for example
ok deraadt mbalmer

Revision 1.27 / (download) - annotate - [select for diffs], Sat May 27 17:01:07 2006 UTC (18 years ago) by henning
Branch: MAIN
Changes since 1.26: +11 -2 lines
Diff to previous 1.26 (colored)

config file bits for timedelta sensors, so one can specify which devices
to use. "sensors *" just uses all. untested due to lack of hardware.
hacked on the road somewhere between vancouver and calgary

Revision 1.26 / (download) - annotate - [select for diffs], Fri May 26 01:06:12 2006 UTC (18 years ago) by deraadt
Branch: MAIN
Changes since 1.25: +2 -4 lines
Diff to previous 1.25 (colored)

\<char> is <char> except for \<newline> -- no exceptions.  much like how
other things work.  ok henning

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jun 19 16:42:57 2005 UTC (18 years, 11 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.24: +5 -1 lines
Diff to previous 1.24 (colored)

use a little state engine to keep track of delayed dns lookups and such,
eases things
tested by Jason Ackley <jason@ackley.net> Matthias Kilian
<kili@outback.escape.de> Stephen Marley <stephen@marley.org.uk> sturm@
theo ok

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 25 06:27:41 2004 UTC (19 years, 6 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.23: +5 -4 lines
Diff to previous 1.23 (colored)

fix "listen on hostname"
fallout from the deferred dns lookups
noticed by dhartmei@

Revision 1.23 / (download) - annotate - [select for diffs], Wed Nov 10 11:27:54 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

const'ify conffile
From: Joerg Sonnenberger <joerg@britannica.bec.de>

Revision 1.22 / (download) - annotate - [select for diffs], Fri Nov 5 14:28:29 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.21: +5 -1 lines
Diff to previous 1.21 (colored)

memleaks in error pathes, patrick latifi, Thanks!

Revision 1.21 / (download) - annotate - [select for diffs], Wed Sep 15 00:23:08 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.20: +3 -26 lines
Diff to previous 1.20 (colored)

kill another unused function and two debugging printfs

Revision 1.20 / (download) - annotate - [select for diffs], Wed Sep 15 00:18:12 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
Changes since 1.19: +2 -166 lines
Diff to previous 1.19 (colored)

remove the unused variable/macro code, ok theo

Revision 1.19 / (download) - annotate - [select for diffs], Tue Aug 10 12:45:27 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.18: +21 -13 lines
Diff to previous 1.18 (colored)

in the pool case ("servers somepool.somewhere"), we add new peers while
looping over the addresses returned by the dns lookup, as each address
is one new peer.
however, if the lookup fails with a temporary error, we will try to lookup
later again. for that, we obviously need to insert one peer with the
hostname in addr_head... change one for() loop into a do { } while() one

Revision 1.18 / (download) - annotate - [select for diffs], Tue Aug 10 12:41:15 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.17: +3 -10 lines
Diff to previous 1.17 (colored)

move memory allocation for new peers into a new function, makes ID allocation
easier

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 29 11:01:48 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.16: +5 -1 lines
Diff to previous 1.16 (colored)

keep an ID per server we talk to

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jul 28 16:56:21 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.15: +8 -1 lines
Diff to previous 1.15 (colored)

prevent unresolvable hostnames in "listen on" statements

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jul 28 16:38:43 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

when a dns lookup fails at parse time, do not abort but try again
to resolve the hostname every 60 seconds
fixes ntpd invocations before e. g. a dialup link is established and such.
as we want ntpd to be a "fire and forget" background daemon it should
cope with such situations.
tested by many

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jul 21 09:40:55 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

no multiple free(); "John L. Scarfone" <j0@cox.net>

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 20 16:47:55 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.12: +30 -9 lines
Diff to previous 1.12 (colored)

wrap the heads for the linked list of addresses into a new ntp_addr_wrap
which, besides the head pointer for the list of course, stores the original
address as specified (i. e. as hostname instead of resolved IPs) and flags
and such.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jul 12 09:22:38 2004 UTC (19 years, 11 months ago) by dtucker
Branch: MAIN
Changes since 1.11: +1 -2 lines
Diff to previous 1.11 (colored)

Replace errx with equivalent fprintf+exit to make porting easier; ok henning@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jul 9 19:28:03 2004 UTC (19 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Do not forget to initialize head. ok henning@

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 9 10:53:33 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.9: +28 -8 lines
Diff to previous 1.9 (colored)

rework dns handling with all its cosequences...
we know have both a "server" and "servers" keyword. they differ when the
hostname resolves to more than one IP, server picks one and servers expands
to all.
that means no longer stuffing a sockaddr_storage into ntp_peer but a pointer
to a linked list of ntp_addr structs.
in the "servers" case the list of n addresses returned by host() is expanded
into n ntp_peer structs and thus n individual peers.
in the "server" case the whole list is attached to ntp_peer, and whenever we
do not receive a reply in time we traverse the list one further, so that
hosts with both AAAA and A records are first tried with the AAAA one but
we gracefully fall back to the A one.
semantics with theo; hacked up on the Montreal->Frankfurt flight.
again Air Canada surprised me, that older 767 hat pretty decent seats.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 8 15:06:43 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.8: +2 -29 lines
Diff to previous 1.8 (colored)

kill traces of on-the-fly reconfigure (from bgpd), not needed in ntpd

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jul 8 01:22:57 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.7: +2 -16 lines
Diff to previous 1.7 (colored)

remove all handling of netmasks/prefix lengths - we don't need that in ntpd.
fixes the dns resolves to v4 and v6 addresses bug found by phessler
hacked on the Calgary->Montreal flight that proved that Air Canada _does_
have some modern aircrafts with good seats

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 7 06:51:16 2004 UTC (19 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

knf!

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jul 7 05:47:57 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.5: +17 -4 lines
Diff to previous 1.5 (colored)

do not listen anywhere by default.
listen on *
listens, well, everywhere.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jul 7 03:15:37 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.4: +40 -24 lines
Diff to previous 1.4 (colored)

swicth all the host_* functions to work on a newly invented
struct ntp_addr, which just wraps a sockaddr_storage and a next pointer,
so that host_dns can return more than one entry.
let host_dns do exactly that, return a list of all IPs for that hostname
adjust all callers in the grammar to cope with that

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jul 6 23:08:26 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

sizeof(wrong struct) in calloc == bad. ^$&(#^$%&#*)!

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jul 5 07:57:52 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.2: +1 -6 lines
Diff to previous 1.2 (colored)

don't limit to one remote server any more

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jun 17 19:17:48 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.1: +30 -2 lines
Diff to previous 1.1 (colored)

provide most of the client functionality.
hook the descriptors into the main poll and such.
we're not doing anything with the reply we recive yet, tho.

mostly hacked on the Frankfurt->Montreal flight, as batteries and those
horrible air canada seats permitted...

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 1 21:58:09 2004 UTC (20 years ago) by henning
Branch: MAIN

first cut at config file parser
for now, one can set the addresses to listen on

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.