reyk
08ed721594
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@
8 years ago
bcook
cdb73978a9
replace bzero with memset
ok phessler@ deraadt@
9 years ago
reyk
127f310cec
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@
9 years ago
reyk
2a9806d4a4
spacing
9 years ago
deraadt
eb02123984
remove excessive/wrong use of sys/param.h
peanuts -- but all work has to start somewhere.
9 years ago
chl
059cda96b7
remove set but not used variable
found while building portable OpenNTPD
ok henning@
10 years ago
phessler
590be54dcd
remove the IPv4-only check for rdomains, allows IPv6 to use them
OK claudio@ henning@
11 years ago
mglocker
27f85bb7b7
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
11 years ago
phessler
a32e45b068
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@
13 years ago
henning
e519398421
fix looking at the mode bits so that we do not reply to broadcast and other
junk. from thorsten glaser.
15 years ago
deraadt
1aa383330e
delete operation not needed; from naddy
16 years ago
deraadt
7a1c705b0b
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
16 years ago
naddy
ca3fb2ec5f
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@
16 years ago
otto
1f8bd32eb8
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@
18 years ago
otto
b10a9a26fe
remove some unneeded includes; one found by vetinari
18 years ago
otto
89f43414db
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@
18 years ago
dtucker
a37ee71683
Do not attempt to listen on interfaces with a wildcard address; ok henning@
19 years ago
dtucker
d71b0751da
Check SA_LEN(sa) after sa is checked for NULL. Pointed out by solar at
openwall.com, ok henning@
19 years ago
dtucker
73c6d5ec9f
Log source address for 'malformed packet' errors. ok henning@
19 years ago
dtucker
f31cfdaa27
Propogate server's leap indicator flags to clients; ok henning@
19 years ago
dtucker
020dd82b59
Skip invalid interfaces during 'listen on *'; ok henning@
19 years ago
dtucker
f9299bb123
Save transmit time for each peer for later use as refid for SNTPv4
replies. ok henning@
19 years ago
henning
e7bcb5fe62
ifa->ifa_addr can be NULL in some cases, pt out by Kurt Roeckx
<kurt@roeckx.be> / bugs.debian.org/310586
19 years ago
dtucker
e0c54820e7
Make network unreachable errors non-fatal; ok henning@
20 years ago
dtucker
621223eef3
Save original value returned by getifaddrs to free later; ok henning@
20 years ago
mickey
b521cde7ce
uniquely name members of s_fixedpt and l_fixedpt; henning@ ok
20 years ago
henning
d94b864a67
in server mode reply with stratum from the peer that we currently prefer
plus one
20 years ago
dtucker
3b0155d86c
Only set IPTOS_LOWDELAY on IPv4 interfaces; pointed out by phessler, ok henning
20 years ago
dtucker
dcc316e5a2
Have ntpd use IPTOS_LOWDELAY; ok henning@
20 years ago
henning
a4e395e47f
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.
20 years ago
henning
7096d1be44
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.
20 years ago
henning
003e3aa51d
ignore ntp_sendmsg()s return value in server_dispatch. could result in
ntpd exiting on sendmsg() failures, which is not desired.
20 years ago
henning
7253f8812f
there are a few recvfrom(2) errors we do not want to panic on
20 years ago
henning
4a343adcd5
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...
20 years ago
alexander
56d2eb7b65
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@
20 years ago
alexander
6ea5a8e216
ignore obviously malformed queries; ok henning@
20 years ago
dtucker
e8355e306b
Use SA_LEN(sa) instead of sa->sa_len; ok henning@
20 years ago
alexander
353bc5222d
* 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@
20 years ago
henning
f429ec57f6
ease code and tweak logging
20 years ago
henning
e74cfb6cd2
do not listen anywhere by default.
listen on *
listens, well, everywhere.
20 years ago
henning
bc7ac3d288
KNF
20 years ago
alexander
381c8ef653
When no listener is specified, create a listener on every IP. Problem
reported by Peter Hessler. ok henning@
20 years ago
henning
c1beef1cf2
size struct pollfd and idx2peer dynamically instead of imposing an arbitary
limit on OPEN_MAX, modeled after bgpd
20 years ago
henning
44782aec16
prepare for client functionality
20 years ago