OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.44 / (download) - annotate - [select for diffs], Sat Sep 3 11:52:06 2016 UTC (7 years, 8 months ago) by reyk
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, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, HEAD
Changes since 1.43: +4 -4 lines
Diff to previous 1.43 (colored)

Remove the oh so funny "LOSS OF MIND" from the diclaimer that was not
part of the original ISC license that we use in OpenBSD.  Done for
files were Henning is the original author.

OK henning@ deraadt@

Revision 1.43 / (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_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

replace bzero with memset

ok phessler@ deraadt@

Revision 1.42 / (download) - annotate - [select for diffs], Tue May 19 16:07:38 2015 UTC (9 years ago) by reyk
Branch: MAIN
Changes since 1.41: +10 -19 lines
Diff to previous 1.41 (colored)

Get the rdomain from the newly exposed ifi_rdomain field in if_data
instead of calling the SIOCGIFRDOMAIN ioctl for every single address.

OK deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Feb 10 11:46:39 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.40: +4 -4 lines
Diff to previous 1.40 (colored)

spacing

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jan 9 07:35:37 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

remove excessive/wrong use of sys/param.h
peanuts -- but all work has to start somewhere.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jun 3 18:42:29 2014 UTC (10 years ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.38: +1 -4 lines
Diff to previous 1.38 (colored)

remove set but not used variable

found while building portable OpenNTPD

ok henning@

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

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

OK claudio@ henning@

Revision 1.37 / (download) - annotate - [select for diffs], Tue Apr 30 11:42:56 2013 UTC (11 years, 1 month ago) by mglocker
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Remove unused function argument variables 'len' and 'auth' from
ntp_sendmsg().  They have been removed from the function body in the past
but not from the argument list.

From Maxime Villard

Revision 1.36 / (download) - annotate - [select for diffs], Wed Sep 21 15:41:30 2011 UTC (12 years, 8 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.35: +72 -38 lines
Diff to previous 1.35 (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.35 / (download) - annotate - [select for diffs], Wed May 20 14:55:59 2009 UTC (15 years 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, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.34: +4 -2 lines
Diff to previous 1.34 (colored)

fix looking at the mode bits so that we do not reply to broadcast and other
junk. from thorsten glaser.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Nov 10 17:55:36 2008 UTC (15 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.33: +1 -2 lines
Diff to previous 1.33 (colored)

delete operation not needed; from naddy

Revision 1.33 / (download) - annotate - [select for diffs], Mon Nov 10 16:59:33 2008 UTC (15 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +17 -6 lines
Diff to previous 1.32 (colored)

If a bind() spuriously fails (as appears to happen once in a blue moon due
to some stupid ipv6 bug in particular), remove that 'listen' from the list
and continue operation.  issue spotted by naddy
ok henning

Revision 1.32 / (download) - annotate - [select for diffs], Tue Jun 10 03:46:09 2008 UTC (15 years, 11 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.31: +2 -6 lines
Diff to previous 1.31 (colored)

According to the latest SNTPv4 spec in RFC4330, secondary servers
return the address of the synchronization source as reference
identification.  Remove the obsolete special casing specified in RFC2030.
ok henning@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jan 15 08:19:11 2007 UTC (17 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.30: +14 -14 lines
Diff to previous 1.30 (colored)

Although Unix compilers accept more than one definition of a global
symbol, follow the guidelines from K&R: only one definition of a
global symbol (and possibly more declarations).  Rename some vars
here and there to avoid shadowing. ok henning@

Revision 1.30 / (download) - annotate - [select for diffs], Sat Jul 1 18:52:46 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored)

remove some unneeded includes; one found by vetinari

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jun 7 06:29:03 2006 UTC (17 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Compensate old offsets with the amount of adjustment done, avoiding
overcompensating. From DragonFly, uses recent adjtime(2) changes,
so you'll need a recent kernel. ok henning@

Revision 1.28 / (download) - annotate - [select for diffs], Thu Jan 19 11:20:23 2006 UTC (18 years, 4 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.27: +15 -1 lines
Diff to previous 1.27 (colored)

Do not attempt to listen on interfaces with a wildcard address; ok henning@

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jan 19 06:40:16 2006 UTC (18 years, 4 months ago) by dtucker
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Check SA_LEN(sa) after sa is checked for NULL.  Pointed out by solar at
openwall.com, ok henning@

Revision 1.26 / (download) - annotate - [select for diffs], Sat Sep 24 00:32:03 2005 UTC (18 years, 8 months ago) by dtucker
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Log source address for 'malformed packet' errors.  ok henning@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Aug 10 13:48:36 2005 UTC (18 years, 9 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.24: +6 -2 lines
Diff to previous 1.24 (colored)

Propogate server's leap indicator flags to clients; ok henning@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jul 22 08:58:56 2005 UTC (18 years, 10 months ago) by dtucker
Branch: MAIN
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored)

Skip invalid interfaces during 'listen on *'; ok henning@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Jul 5 10:09:12 2005 UTC (18 years, 11 months ago) by dtucker
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Save transmit time for each peer for later use as refid for SNTPv4
replies.  ok henning@

Revision 1.22 / (download) - annotate - [select for diffs], Tue May 24 20:10:50 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.21: +4 -3 lines
Diff to previous 1.21 (colored)

ifa->ifa_addr can be NULL in some cases, pt out by Kurt Roeckx
<kurt@roeckx.be> / bugs.debian.org/310586

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jan 28 12:01:32 2005 UTC (19 years, 4 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Make network unreachable errors non-fatal; ok henning@

Revision 1.20 / (download) - annotate - [select for diffs], Wed Dec 22 05:36:11 2004 UTC (19 years, 5 months ago) by dtucker
Branch: MAIN
Changes since 1.19: +5 -5 lines
Diff to previous 1.19 (colored)

Save original value returned by getifaddrs to free later; ok henning@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 8 15:47:38 2004 UTC (19 years, 5 months ago) by mickey
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

uniquely name members of s_fixedpt and l_fixedpt; henning@ ok

Revision 1.18 / (download) - annotate - [select for diffs], Fri Oct 22 21:17:37 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

in server mode reply with stratum from the peer that we currently prefer
plus one

Revision 1.17 / (download) - annotate - [select for diffs], Fri Oct 15 01:58:04 2004 UTC (19 years, 7 months ago) by dtucker
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Only set IPTOS_LOWDELAY on IPv4 interfaces; pointed out by phessler, ok henning

Revision 1.16 / (download) - annotate - [select for diffs], Thu Oct 14 09:35:48 2004 UTC (19 years, 7 months ago) by dtucker
Branch: MAIN
Changes since 1.15: +6 -1 lines
Diff to previous 1.15 (colored)

Have ntpd use IPTOS_LOWDELAY; ok henning@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Oct 13 14:02:50 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.14: +2 -1 lines
Diff to previous 1.14 (colored)

set rootdelay in replies.
inherit rootdelay from the delay from the last client update from the peer
that we picked last time to adjust the local clock.
in some cases we use the average offset between two peers' client updates,
then use the average delay between the two as well.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Oct 13 12:22:39 2004 UTC (19 years, 7 months ago) by henning
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

correctly set refid in replies with NTP protocol versions < 4.
code path for NTP4 remains unchanged, we already set refid correctly there.
NTP3 and older uses an IPv4 address as refid.
use the IP of the server we last synced to if it was a IPv4 one.
sometimes we use the average offset between two, in that case just pick
one for the IP.
this scheme naturally fails when we query IPv6 servers and have to reply
to IPv4 NTP3 (or even older NTP versions) clients - refid stays at 0 then.
this is a protocol limitation, nothing we can do about it.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Sep 7 22:43:07 2004 UTC (19 years, 8 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

ignore ntp_sendmsg()s return value in server_dispatch. could result in
ntpd exiting on sendmsg() failures, which is not desired.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jul 18 13:26:53 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.11: +10 -3 lines
Diff to previous 1.11 (colored)

there are a few recvfrom(2) errors we do not want to panic on

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jul 14 20:16:31 2004 UTC (19 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

do not do the stratum guessing dance.
stratum is pretty much pointless anyway these days, and we certainly
do not want to send out illegal packets (stratum=0) until synced...

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jul 13 19:41:26 2004 UTC (19 years, 10 months ago) by alexander
Branch: MAIN
Changes since 1.9: +15 -7 lines
Diff to previous 1.9 (colored)

Respond to client queries with better server statistics.  We now output
a close-to-reality stratum, a real reference time, and a leap indicator
that will indicate if the local clock isn't synchronized.

This also means that until the server feels it's synchronized, it will
tell the clients it isn't.  This is normal, and correct.

ok henning@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jul 13 17:27:57 2004 UTC (19 years, 10 months ago) by alexander
Branch: MAIN
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

ignore obviously malformed queries; ok henning@

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jul 11 03:05:50 2004 UTC (19 years, 10 months ago) by dtucker
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Use SA_LEN(sa) instead of sa->sa_len; ok henning@

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 7 07:32:05 2004 UTC (19 years, 10 months ago) by alexander
Branch: MAIN
Changes since 1.6: +26 -24 lines
Diff to previous 1.6 (colored)

* Convert to use the new double-based time handling functions.
* Respond to the query with a reasonable received time (which
  will help clients get better accuracy).
* Consolidate the server response code in preparation for a
  completely 'proper' response to the client.

tips and ok from henning@

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

ease code and tweak logging

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

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

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jul 4 18:07:15 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.3: +6 -12 lines
Diff to previous 1.3 (colored)

KNF

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jun 29 18:34:00 2004 UTC (19 years, 11 months ago) by alexander
Branch: MAIN
Changes since 1.2: +44 -21 lines
Diff to previous 1.2 (colored)

When no listener is specified, create a listener on every IP.  Problem
reported by Peter Hessler.  ok henning@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 18 04:51:31 2004 UTC (19 years, 11 months ago) by henning
Branch: MAIN
Changes since 1.1: +7 -2 lines
Diff to previous 1.1 (colored)

size struct pollfd and idx2peer dynamically instead of imposing an arbitary
limit on OPEN_MAX, modeled after bgpd

Revision 1.1 / (download) - annotate - [select for diffs], Wed Jun 2 10:08:59 2004 UTC (20 years ago) by henning
Branch: MAIN

prepare for client functionality

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.