summaryrefslogtreecommitdiff
path: root/src/timesync
Commit message (Collapse)AuthorAge
* add REMOTE_ADDR and REMOTE_PORT for Accept=yesShawn Landden2015-03-10
|
* Do not advertise .d snippets over main config fileZbigniew Jędrzejewski-Szmek2015-03-03
| | | | | | | | | | For daemons which have a main configuration file, there's little reason for the administrator to use configuration snippets. They are useful for packagers which need to override settings, but we shouldn't advertise that as the main way of configuring those services. https://bugs.freedesktop.org/show_bug.cgi?id=89397
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | 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.
* timesync: Use UINT64_C for OFFSET_1900_1970Cristian Rodríguez2015-02-16
| | | | So it matches what the comment says in both 32 and 64 bit systems.
* Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"Lennart Poettering2015-02-12
| | | | | | | This reverts commit d6d810fbf8071f8510450dbacd1d083f37603656. It's apparently not OK to pass MSG_CMSG_CLOEXEC to recvmsg() of raw sockets.
* tree-wide: Always use recvmsg with MSG_CMSG_CLOEXECCristian Rodríguez2015-02-10
|
* timesyncd: downgrade more log messages from LOG_INFO to LOG_DEBUGLennart Poettering2015-02-04
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=87505 Let's make timesyncd less chatty.
* timesyncd: reduce log chattiness a bitLennart Poettering2015-02-04
| | | | | | Let's downgrade the statistics output from LOG_INFO to LOG_DEBUG. https://bugs.freedesktop.org/show_bug.cgi?id=88926
* timesyncd: set RLIMIT_NPROC to 2Lennart Poettering2015-01-27
| | | | | | | | | This way timesyncd cannot be used to fork(). Note that it generally is not safe to use RLIMIT_NPROC, since it breaks running the same daemon in multiple containers if they do not use user namespacing. However, timesyncd is excepted from running in a container anyway, hence it is safe in this case.
* timesyncd: consider too long packets as invalidTopi Miettinen2015-01-18
| | | | | | | | 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)
* timesync: remove square(), use pow insteadCristian Rodríguez2014-12-25
| | | | | In any case, the compiler generates the same code inline and never actually calls the library function.
* timesyncd: minor simplificationLennart Poettering2014-11-30
|
* timesyncd: Support timesyncd.conf.d directories in the usual search pathsJosh Triplett2014-11-29
|
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | 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.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | 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.
* treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt2014-11-28
|
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | 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().
* timesyncd: do not keep listening socket open foreverSean Young2014-11-27
| | | | This also makes the source port less predicatable.
* timesyncd: the IP_TOS sockopt is really just an optimization, we shouldn't ↵Lennart Poettering2014-10-24
| | | | | | fail if we can't set it This partially undos 2f905e821e0342c36f5a5d3a51d53aabccc800bd
* util: avoid duplication of TIME_T_MAXRonny Chevalier2014-10-21
|
* timesyncd: check return of setting IP_TOSTom Gundersen2014-09-18
| | | | Fonud by Coverity. Fixes CID #1237534.
* Revert "timesyncd: remove retry_timer logic which is covered by the server ↵Kay Sievers2014-09-02
| | | | | | | | | | | 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.
* timesyncd: don't reset polling interval when reselecting serverKay Sievers2014-09-02
| | | | Original patch from: Miroslav Lichvar <mlichvar@redhat.com>
* timesyncd: allow two missed replies before reselecting serverMiroslav Lichvar2014-09-02
| | | | | | 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.
* timesyncd: remove retry_timer logic which is covered by the server timeoutKay Sievers2014-09-02
|
* timesyncd: wait before reconnecting to first serverMiroslav Lichvar2014-09-02
| | | | | | | | 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.
* timesyncd-manager: don't clear current_server_name if ServerAddress is NULLSteven Noonan2014-08-30
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=83091 [zj: add comment]
* timesyncd: check root distanceMiroslav Lichvar2014-08-29
| | | | | | | | | 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.
* timesyncd: get kernel timestamp in nanosecondsMiroslav Lichvar2014-08-29
|
* timesyncd: fix calculation of transmit timeMiroslav Lichvar2014-08-29
| | | | | The kernel timestamp (recv_time) is made earlier than current time (now_ts), use the timestamp captured before sending packet directly.
* timesyncd: check if stratum is validMiroslav Lichvar2014-08-29
|
* notify: send STOPPING=1 from our daemonsLennart Poettering2014-08-21
|
* timesyncd: don't trip up if networkd isn't running and can't tell us any NTP ↵Lennart Poettering2014-08-13
| | | | servers
* timesyncd: beef up NTP server selection logic, and acquire NTP servers from DHCPLennart Poettering2014-08-12
|
* timesyncd: split up into multiple source fileLennart Poettering2014-08-12
| | | | | The source file got much too large, hence split up the sources into multiple per-object files, similar in style to resolved.
* timesyncd: move the generic sockaddr_equal() call to socket-util.hLennart Poettering2014-08-12
|
* timesyncd: when we don't know anything about the network state, assume we ↵Lennart Poettering2014-08-11
| | | | | | are online This should provide better compatibility with systems that lack networkd
* timesyncd: always use CLOCK_BOOTTIME if we canLennart Poettering2014-08-11
| | | | | After all we want to compare a monotonically increasing clock with the remote clock, hence we shouldn't ignore system suspend periods.
* Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | | | $ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument
* Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | | | | | | | | | | | | | | | | | String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird
* core: only set the kernel's timezone when the RTC runs in local timeKay Sievers2014-07-27
| | | | | | | | | | | | | | | | | | | We can not reliably manage any notion of local time. Every daylight saving time change or time zone change by traveling will make the time jump, and the local time might jump backwards which creates unsolvable problems with file timestamps. We will no longer tell the kernel our local time zone and leave everything set to UTC. This will effectively turn FAT timestamps into UTC timestamps. If and only if the machine is configured to read the RTC in local time mode, the kernel's time zone will be configured, but systemd-timesysnc will disable the kernel's system time to RTC syncing. In this mode, the RTC will not be managed, and external tools like Windows bootups are expected to manage the RTC's time. https://bugs.freedesktop.org/show_bug.cgi?id=81538
* sd-network: fix parameter order for sd_network_monitor_new()Lennart Poettering2014-07-17
| | | | | | Constructors should return the object they created as first parameter, except when they are generated as a child/member object of some other object in which case that should be first.
* Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek2014-07-16
| | | | | | | | Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
* Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek2014-07-15
|
* timesyncd: add sockaddr_pretty wrapperZbigniew Jędrzejewski-Szmek2014-07-15
|
* timesyncd: only listen to clock changes when connectedZbigniew Jędrzejewski-Szmek2014-07-15
| | | | | | | | | | | | | This reverts previous commit and applies a different fix. manager_clock_watch() callback calls manager_send_request() to kick off a resync. We can only do that when we're actually connected to something. It is not useful to setup the callback from manager_new(). Now the callback will be dropped in manager_connect() and requested in manager_begin(). https://bugs.freedesktop.org/show_bug.cgi?id=80932
* timesyncd: suppress resync at system time change when not connectedKay Sievers2014-07-15
| | | | | | | | | Jul 04 17:46:03 orchid systemd[1]: Starting Network Time Synchronization... Jul 04 17:46:03 orchid systemd[1]: Started Network Time Synchronization. Jul 04 17:46:22 orchid systemd-timesyncd[301]: System time changed. Resyncing. Jul 04 17:46:22 orchid systemd-timesyncd[301]: Assertion 'm->current_server_name' https://bugs.freedesktop.org/show_bug.cgi?id=80932
* resolved: make use of union in_addr_union in resolved, tooLennart Poettering2014-07-07
|