OpenBSD CVS

CVS log for src/usr.sbin/ntpd/config.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.33 / (download) - annotate - [select for diffs], Sun Apr 12 14:20:56 2020 UTC (4 years, 1 month ago) by otto
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, 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, HEAD
Changes since 1.32: +5 -2 lines
Diff to previous 1.32 (colored)

If all addresses are numeric no use for dns probe; ok florian@ sthen@

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jul 7 07:14:57 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Sometimes ntp peers are unreliable (looking at you pool.ntp.org!)
and net config can change as well. So if a peer does not respond,
throw it out of the pool if it's a pool member and re-resolve to
find a replacement. Hold on to good peers so we end up with a good
set of peers. ok benno@

Revision 1.31 / (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.30: +3 -3 lines
Diff to previous 1.30 (colored)

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

Revision 1.30 / (download) - annotate - [select for diffs], Tue May 28 06:49:46 2019 UTC (5 years ago) by otto
Branch: MAIN
Changes since 1.29: +23 -2 lines
Diff to previous 1.29 (colored)

A step in solving the bootstrap problem in a dnssec environement.
If the time is wrong, we cannot validate dnssec, leading to failed
DNS lookups, so we cannot adjust or set the time.  Work around this
by repeating a failed DNS lookup with a lookup with the DC (check
disabled) bit set. ok florian@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Sep 7 20:31:39 2018 UTC (5 years, 9 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.28: +20 -68 lines
Diff to previous 1.28 (colored)

Make host_*() AF-agnostic

Merge host_v{4,6}() into much simpler host_ip() using just getaddrinfo().

host_dns() uses the same procedure.

OK naddy

Revision 1.28 / (download) - annotate - [select for diffs], Mon Oct 12 06:50:08 2015 UTC (8 years, 7 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Move execution of the constraints from the ntp to the parent process.
This helps the ntp process to a) give a better pledge(2) and to b)
keep the promise of "saving the world again... on time" by removing
the delays that have been introduced by expensive constraint forks.
The new design offers better privsep but introduces a few more imsgs
and runs a little bit more code in the privileged parent.  The
privileged code is minimal, carefully checked, and does not attempt to
"parse" any contents; the forked constraints instantly drop all
privileges and pledge to "stdio inet".

OK beck@ deraadt@

Revision 1.27 / (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.26: +4 -4 lines
Diff to previous 1.26 (colored)

replace bzero with memset

ok phessler@ deraadt@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Feb 10 06:40:08 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.25: +15 -1 lines
Diff to previous 1.25 (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.25 / (download) - annotate - [select for diffs], Sun Feb 8 04:54:15 2015 UTC (9 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

Add a comment that ntpd MUST NOT use AI_ADDRCONFIG in host_dns()

OK henning@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jan 19 11:44:08 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.23: +1 -3 lines
Diff to previous 1.23 (colored)

remove a couple of unused headers.

reported by Jonas 'Sortie' Termansen

Revision 1.23 / (download) - annotate - [select for diffs], Tue Jan 13 02:28:56 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.22: +12 -1 lines
Diff to previous 1.22 (colored)

fix some memory leaks in dns handling.

 - Nothing seems to free the result of host_dns(), so add host_dns_free() and
   call after each query.
 - If imsg_add() fails, it frees buf. Avoid subsequently dereferencing the
   freed buf in imsg_close().

ok millert@ deraadt@

Revision 1.22 / (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.21: +3 -5 lines
Diff to previous 1.21 (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.21 / (download) - annotate - [select for diffs], Sat Jan 10 01:56:52 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

revert host() back to correct behavior.

unbreak config file address parsing

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 9 23:48:21 2015 UTC (9 years, 5 months ago) by bcook
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

return -1 on host() address parsing failure, not 1.

Match what parse.y expects it to return.

ok millert@

Revision 1.19 / (download) - annotate - [select for diffs], Sat May 27 17:01:07 2006 UTC (18 years ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.18: +15 -2 lines
Diff to previous 1.18 (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.18 / (download) - annotate - [select for diffs], Wed May 11 15:12:35 2005 UTC (19 years, 1 month ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.17: +4 -2 lines
Diff to previous 1.17 (colored)

don't touch *hn in failure case. no real change due to the way we use it
but more correct.
from  Michael Knudsen <e@molioner.dk>

Revision 1.17 / (download) - annotate - [select for diffs], Wed Mar 9 20:31:11 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (colored)

nasty: host_dns used to run before forking and chrooting etc, so it was
guaranteed that its res_init() call was done once before fork etc...
that is no longer the case. call res_init() in main() early.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Mar 8 14:59:36 2005 UTC (19 years, 3 months ago) by henning
Branch: MAIN
Changes since 1.15: +4 -6 lines
Diff to previous 1.15 (colored)

from the "shut the fuck up, ntpd" department:
don't whine about temporary dns errors

Revision 1.15 / (download) - annotate - [select for diffs], Thu Dec 16 00:38:59 2004 UTC (19 years, 5 months ago) by dtucker
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Limit the number of addresses used by the 'servers' directive to 8; ok henning@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Aug 30 12:02:59 2004 UTC (19 years, 9 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (colored)

don't forget to set *hn... theo ok

Revision 1.13 / (download) - annotate - [select for diffs], Mon Aug 30 11:52:04 2004 UTC (19 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +3 -7 lines
Diff to previous 1.12 (colored)

skip early DNS lookups -- they are deferred to later; ok otto ho henning

Revision 1.12 / (download) - annotate - [select for diffs], Tue Aug 24 15:23:19 2004 UTC (19 years, 9 months ago) by henning
Branch: MAIN
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

don't fatal() if getaddrinfo() returns EAI_NONAME

Revision 1.11 / (download) - annotate - [select for diffs], Thu Aug 12 16:33:59 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

do not try to getaddrinfo() in the unprivileged process, send an imsg
asking the privileged one to do it. sends back an imsg with the
resulting addresses in a bunch of struct sockaddr_storage in the data
part.
this should fix all remaining issues with dns (non-)availability at
ntpd startup, be it due to named on localhost or something else.
tested by marco@ and Chris Paul <chris.paul@sentinare.com>

Revision 1.10 / (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.9: +21 -3 lines
Diff to previous 1.9 (colored)

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

Revision 1.9 / (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.8: +22 -13 lines
Diff to previous 1.8 (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.8 / (download) - annotate - [select for diffs], Sun Jul 25 18:27:58 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.7: +1 -24 lines
Diff to previous 1.7 (colored)

remove unused function

Revision 1.7 / (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.6: +12 -43 lines
Diff to previous 1.6 (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.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: +5 -1 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:53:14 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.4: +5 -5 lines
Diff to previous 1.4 (colored)

host_* now returns pointers, so the error return is NULL and not 0

Revision 1.4 / (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.3: +40 -33 lines
Diff to previous 1.3 (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.3 / (download) - annotate - [select for diffs], Tue Jul 6 18:03:07 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.2: +51 -3 lines
Diff to previous 1.2 (colored)

allow hostnames and resolve them in the config file

Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 2 10:08:59 2004 UTC (20 years ago) by henning
Branch: MAIN
Changes since 1.1: +1 -4 lines
Diff to previous 1.1 (colored)

prepare for client functionality

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 1 21:58:08 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.