Commit graph

76 commits

Author SHA1 Message Date
Timo Teras
0666d04ab2 Set reply source IP from query destination IP
Currently, on multihomed host, when chrony is not bound to a specific
IP address, a query is sent to an interface and the default source IP
hint for the back route differs, the reply will have a source IP
different than where the query was destinied to. This will cause
problems because connection tracking firewalls will drop the replies
and most likely the client program will get confused too.

This patch uses the IP_PKTINFO mechanism to get the IP address where
received packets where targetted to and use that IP address as source
hint when sending a reply.
2009-08-07 17:02:11 +02:00
Timo Teras
d87cddd6a5 Switch to recvmsg/sendmsg to get access to control messages 2009-08-07 14:27:51 +02:00
Miroslav Lichvar
84cbeeadd1 Add editline support
GNU readline recently changed license to GPLv3+ which makes it
incompatible with chrony (GPLv2). This patch adds support for editline
library (BSD license).
2009-07-17 12:48:00 +02:00
Miroslav Lichvar
eefb5c7552 Fix compiler warnings in getdate.c 2009-07-06 11:49:26 +02:00
Miroslav Lichvar
8c0f3f4042 Try to minimize adjtime error
The offset is rounded before calling adjtime and the error below
microsecond is accumulated.
2009-07-01 15:56:00 +02:00
Miroslav Lichvar
735811b2b9 Add median filter for refclocks 2009-07-01 15:55:56 +02:00
Miroslav Lichvar
923c58485f Add client support for Kiss-of-Death RATE
This adds support for RATE code which can be used in reply from NTP
server to reduce client's polling.
2009-06-30 18:01:55 +02:00
Miroslav Lichvar
032d1db883 Add support for ADJ_OFFSET_SS_READ mode
Also assume that kernels >= 2.6.27 don't need frequency scaling.
2009-05-20 17:43:09 +02:00
Miroslav Lichvar
75330fdff5 Add SHM refclock driver 2009-05-05 23:06:04 +02:00
Miroslav Lichvar
ac30bb06ef Add support for reference clocks 2009-05-05 23:05:59 +02:00
Miroslav Lichvar
ef3669fe1b Make sure skew isn't 0.0 to avoid segfaults 2009-05-05 08:52:33 +02:00
Miroslav Lichvar
9416a24f03 Don't finalise from signal handler 2009-04-29 13:53:02 +02:00
Miroslav Lichvar
8b81bfe41d Reduce request timeout in chronyc 2009-04-27 16:44:44 +02:00
Miroslav Lichvar
96759116e2 Fix memlockall patch 2009-02-11 18:01:23 +01:00
Miroslav Lichvar
4aae133c4d Fix compiler warnings in wrap_adjtimex.c 2009-02-10 18:06:25 +01:00
John Hasler
35e662d810 Add mlockall and SCHED_FIFO support
The attached patch adds support for mlockall() as well as the SCHED_FIFO
real-time scheduler. It should result in reduced (and more consistent)
latency. Usage is documented in all the documents.
2009-02-10 18:02:28 +01:00
Miroslav Lichvar
cdc22df903 Fix leap sign in measurements log 2009-01-08 13:34:54 +01:00
Miroslav Lichvar
8f9c237010 Leap second support
Leap second status is accepted and forwarded to clients if majority
of selectable sources agree. The actual insertion/deletion is supported
only on Linux now.
2009-01-08 13:33:15 +01:00
Miroslav Lichvar
0148ecaea0 Retry name resolving after temporary failure few times before giving up
This is a temporary fix to allow starting when resolv.conf is not ready yet
(e.g. when using NetworkManager). It may delay start up to 1022 seconds.
2008-11-10 15:54:06 +01:00
Miroslav Lichvar
fd2641bcb9 Fix resolving IP addresses into names on 64-bit big-endian machines 2008-11-06 18:18:41 +01:00
Miroslav Lichvar
be42b4eeea Linux capabilities support
Attached is a patch adding a linux capabilities support to chronyd. It
adds -u option which can be used to specify the user which chronyd
should switch to.
2008-11-05 23:50:48 +00:00
Miroslav Lichvar
8336f14680 Fix errors detected by valgrind
I tried running chronyd in valgrind and the result was that there are four
places where memory is not initialized. A patch fixing the errors is in the
attachment.
2008-11-05 23:48:58 +00:00
John Hasler
bc0aaa9217 Fix fault where chronyd enters an endless loop on x86_64
John writes:
Here is a patch that should prevent the endless loop.  I've changed
UTI_NormaliseTimeval() to use divide/remainder instead of a loop.  It also
replaces some similar loops with calls to UTI_NormaliseTimeval() and fixes
an unrelated bug in UTI_DiffTimevals().
2008-10-01 23:57:20 +01:00
Thomas Zajic
71aa36aa6e Fix IP addressing in chronyc
Thomas wrote:
I found a bug in the chrony client (chronyc) that affects its ability to talk
to remote hosts over the control port (323/udp).

For example, running "chronyc -h 192.168.1.3 sources -v" would just sit there
and hang, and eventually timeout. I found out with tcpdump that chronyc
actually tries to connect to 255.168.1.3 instead of 192.168.1.3.
2008-07-29 23:35:42 +01:00
Goswin Brederlow
2f2446c7dc Fix for chronyc "sources" command on 64 bit machines
(Taken from
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348412
)

Attached is a patchlet to make the "sources" command of chrony output properly
signed numbers. The chronyd code (see e.g. ntp.h) properly uses int32_t and
friends to get the right number of bits per datatype while client.c just uses
short, int, long. But long will be 64 bit or 32 bit depending on the cpu.
2008-03-29 20:49:59 +00:00
Richard P. Curnow
5331e1a146 Update NEWS for 1.23 2007-12-02 14:53:09 +00:00
Richard P. Curnow
eeac7b7ca0 Define io_linux.h constants for x86_64
Based on thread from chrony-users, October 2007.
2007-12-02 14:39:50 +00:00
Richard P. Curnow
efcf3f7c6b git archive's --prefix arg needs a trailing / 2007-06-27 23:57:03 +01:00
Richard P. Curnow
eb4c9d908c Use git-archive instead of the obsolete git-tar-tree in make_release 2007-06-27 23:54:43 +01:00
Richard P. Curnow
b6e40dbde7 Merge branch 'bu' 2007-06-26 23:51:18 +01:00
Richard P. Curnow
4ba843f8f4 Fix formatting from last patch 2007-06-26 23:50:53 +01:00
Bill Unruh
75a7af9edc Fix handling of stratum zero.
Further to the discussion with John Hasler, here are new diffs which
handles the incoming stratum 0 claim of a remote server by redefining the
incoming stratum as one bigger than the Max if it is zero, as per the NTP
version 4 documentation.

If the incoming stratum is zero it sets it to NTP_MAX_STRATUM+1 . If our
current stratum is larger than the NTP_MAX_STRATUM, the outgoing stratum is
also set to zero as per the suggestions in the NTP docs.
Introduces the new NTP_INVALID_STRATUM of 0 for doing these tests or
setting the outgoing stratum.

It is unclear whether chrony wants to follow NTP in setting the outgoing
stratum to zero if it is unknown or invalid, rather than a number larger
than the max stratum. Setting it to zero seems silly, since zero is already
used to define the stratum of a hardware clock (GPS, atomic, etc). This
seems ripe for confusion. But the fact that the ntp docs state to do this,
and that ntp servers (eg ntp.ubc.ca) are already doing this (using 0 to
mean invalid) means that chrony has to handle it on the incoming packets
from the servers.
2007-06-26 23:46:33 +01:00
Bill Unruh
8022874a47 Handle fluctuations in peer distance better. 2007-06-26 23:45:04 +01:00
Richard P. Curnow
ca1195a0e6 Fix whitespace issue with last patch 2007-06-26 23:43:28 +01:00
Bill Unruh
ce4e0a3c2f Fix problems with rtc_linux.
2) Changes to rtc_linux.c which a) do a double read of /dev/rtc when the
PPM interupt is turned on after the wait time expires. The current read
does not block to the second, as it should, thus two reads are needed.

Also, changes so that at startup the system properly ignores the last
system time from the initial burst mode for setting the system time since
it can be way off. At present this last system time is included in the
regression, which throws it off until finally that sample is dropped.
2007-06-26 23:42:11 +01:00
Stefan Lucke
215d988286 Fix sign v zero extension error in handling IP address
I switch to the git version of chrony. Accidently this version did not
talk to by lokal server at 192.168.192.4. Instead it continuosly tried
255.255.192.4 :-( .

Tracked that down to "char", "unsigned char" issue in nameserv.c:
2007-06-26 23:02:33 +01:00
Richard P. Curnow
084efe606f Merge branch 'vm' 2007-06-26 22:13:40 +01:00
Richard P. Curnow
38efaf10a8 configure: fix indentation from previous patch 2007-06-26 22:11:19 +01:00
Vladimir Michl
93f6664378 Allow RTC support to be excluded at compile time.
Add a new option to configure script, allowing
to disable (and exclude) RTC module. It saves same memory.
2007-06-26 22:08:49 +01:00
Vladimir Michl
8a94298b7e Add support for Linux/arm 2007-06-26 22:06:39 +01:00
Richard P. Curnow
242c520912 Fix format of "could not send to" message 2006-04-15 23:57:42 +01:00
Richard P. Curnow
1a4fa3330a Rename round() function to avoid clash with builtin 2006-04-15 00:34:04 +01:00
Richard P. Curnow
fd35174928 Merge quashing of compile warnings 2006-04-15 00:32:08 +01:00
kevin lyda
2a30c56f03 Quash a load of compile warnings
Kevin Lyda writes:
I enclose the following patch which removes all but three of the warnings.  i
don't have any non-linux systems handy to test a fix to the round() function.
but having it return a double should be fine.

It doesn't actually fix anything, it just shuts up -Wall, so it's certainly an
optional type of patch.
2006-04-15 00:31:29 +01:00
Richard P. Curnow
0b8979a41e Fix version.txt to remove compile warning 2006-04-15 00:27:07 +01:00
Eric Lammerts
4771cbe8b0 Fix bogus "system time" report for 64 bit systems
Eric Lammerts writes:
This is known as Debian bug #195620, which is almost three years old!

The problem is that a uint32_t which comes out of ntohl() (but
actually represents a signed value) is directly promoted to long.
Therefore no sign extension takes place.

Patch below solves the problem. There are other places where this
needs to be fixed, but I'll leave that to a less lazy person.
2006-04-15 00:18:28 +01:00
Richard P. Curnow
1e7e7d3231 Remove volatile keyword from function declarations
This silences a lot of gcc-4 compile warnings
2006-04-15 00:10:21 +01:00
Bernhard Weiss
3e7781fdaf Fix linux_io.h for MIPS
Bernard Weiss writes:
I managed to compile the chrony 1.21 package for the MIPS architecture.
For the package to compile I had to add the following lines to io_linux.h:

[patch]

These values are taken from the ioctl.h file of linux 2.4.30 for the MIPS arch
(__ASM_MIPS_IOCTL_H).
2006-04-15 00:07:43 +01:00
NAKAMURA Takumi
acd99f25ef FreeBSD support
NAKAMURA Takumi writes:

I tried to compile chrony-1.21 on FreeBSD 4.8-RELEASE & 5.4-RELEASE.
I modify two files, configure, sysinc.h.

configure:
    add label "FreeBSD-i386" to "BSD/386" line
sysincl.h:
    1. FreeBSD obsoletes alloca.h
    2. FreeBSD use stdlib.h instead of malloc.h, to use malloc(), free()

Attached file includes the above modifications.
2006-04-15 00:03:30 +01:00
Paul Elliott
91a91d1642 Flush chronyc output buffers.
The following is a patch to chronyc that causes it
to flush the buffers to stderr and stdout after
executing each command. This is needed if
you are controling chronyc from a program (i.e. chronyc's
input and output descriptors are pipes which are being
written/read by another program) and
you do not want to block waiting for chronyc response
which is trapped in a buffer!
2006-01-29 23:31:56 +00:00