summaryrefslogtreecommitdiff
path: root/src/timesync/timesyncd-manager.c
AgeCommit message (Collapse)Author
2015-06-10util: introduce CMSG_FOREACH() macro and make use of it everywhereLennart Poettering
It's only marginally shorter then the usual for() loop, but certainly more readable.
2015-04-08timesyncd: print an INFO log message when we successfully reached a time serverLennart Poettering
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-02-16timesync: Use UINT64_C for OFFSET_1900_1970Cristian Rodríguez
So it matches what the comment says in both 32 and 64 bit systems.
2015-02-12Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"Lennart Poettering
This reverts commit d6d810fbf8071f8510450dbacd1d083f37603656. It's apparently not OK to pass MSG_CMSG_CLOEXEC to recvmsg() of raw sockets.
2015-02-10tree-wide: Always use recvmsg with MSG_CMSG_CLOEXECCristian Rodríguez
2015-02-04timesyncd: downgrade more log messages from LOG_INFO to LOG_DEBUGLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=87505 Let's make timesyncd less chatty.
2015-02-04timesyncd: reduce log chattiness a bitLennart Poettering
Let's downgrade the statistics output from LOG_INFO to LOG_DEBUG. https://bugs.freedesktop.org/show_bug.cgi?id=88926
2015-01-18timesyncd: consider too long packets as invalidTopi Miettinen
If the received NTP message from server didn't fit to our buffer, either it is doing something nasty or we don't know the protocol. Consider the packet as invalid. (David: add parantheses around conditional)
2014-12-25timesync: remove square(), use pow insteadCristian Rodríguez
In any case, the compiler generates the same code inline and never actually calls the library function.
2014-11-30timesyncd: minor simplificationLennart Poettering
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
2014-11-28treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-27timesyncd: do not keep listening socket open foreverSean Young
This also makes the source port less predicatable.
2014-10-24timesyncd: the IP_TOS sockopt is really just an optimization, we shouldn't ↵Lennart Poettering
fail if we can't set it This partially undos 2f905e821e0342c36f5a5d3a51d53aabccc800bd
2014-10-21util: avoid duplication of TIME_T_MAXRonny Chevalier
2014-09-18timesyncd: check return of setting IP_TOSTom Gundersen
Fonud by Coverity. Fixes CID #1237534.
2014-09-02Revert "timesyncd: remove retry_timer logic which is covered by the server ↵Kay Sievers
timeout" This reverts commit 665c6a9eab46b0b253af6566ca9fc70c866b3fcd. On Tue, Sep 2, 2014 at 3:17 PM, Miroslav Lichvar <mlichvar@redhat.com> wrote: > > With the other patch allowing missed replies included it's now getting > stuck as there is no timer to send the 2nd and 3rd request.
2014-09-02timesyncd: don't reset polling interval when reselecting serverKay Sievers
Original patch from: Miroslav Lichvar <mlichvar@redhat.com>
2014-09-02timesyncd: allow two missed replies before reselecting serverMiroslav Lichvar
After receiving a reply from the server, allow two missed replies before switching to another server to avoid unnecessary clock hopping when packets are getting lost in the network.
2014-09-02timesyncd: remove retry_timer logic which is covered by the server timeoutKay Sievers
2014-09-02timesyncd: wait before reconnecting to first serverMiroslav Lichvar
When all servers are exhausted, wait for one poll interval before trying to connect again to the first server in the list. Also, keep increasing the polling interval to make sure a client not getting any valid replies will not send requests to any server more frequently than is allowed by the maximum polling interval.
2014-08-30timesyncd-manager: don't clear current_server_name if ServerAddress is NULLSteven Noonan
https://bugs.freedesktop.org/show_bug.cgi?id=83091 [zj: add comment]
2014-08-29timesyncd: check root distanceMiroslav Lichvar
NTPv4 servers don't reply with unsynchronized status when they lost synchronization, they only keep increasing the root dispersion and it's up to the client to decide at which point they no longer consider it synchronized. Ignore replies with root distance over 5 seconds.
2014-08-29timesyncd: get kernel timestamp in nanosecondsMiroslav Lichvar
2014-08-29timesyncd: fix calculation of transmit timeMiroslav Lichvar
The kernel timestamp (recv_time) is made earlier than current time (now_ts), use the timestamp captured before sending packet directly.
2014-08-29timesyncd: check if stratum is validMiroslav Lichvar
2014-08-13timesyncd: don't trip up if networkd isn't running and can't tell us any NTP ↵Lennart Poettering
servers
2014-08-12timesyncd: beef up NTP server selection logic, and acquire NTP servers from DHCPLennart Poettering
2014-08-12timesyncd: split up into multiple source fileLennart Poettering
The source file got much too large, hence split up the sources into multiple per-object files, similar in style to resolved.