diff options
author | Vincent Blut <vincent.debian@free.fr> | 2019-05-14 13:53:03 +0200 |
---|---|---|
committer | Vincent Blut <vincent.debian@free.fr> | 2019-05-14 13:53:03 +0200 |
commit | 1edaaf2a00b0085d1925e8591f4b76d787e9268e (patch) | |
tree | aa474018c8a476212ed2bc0da421d0c995dd725a | |
parent | 260ff57f4f8b263a23841ed67a47e5dc08981f3d (diff) | |
parent | f168ca2c26e4c9f4f6c792730d3f44dd35535edd (diff) |
Update upstream source from tag 'upstream/3.5'
Update to upstream version '3.5'
with Debian dir a41ef6e73092a01e4a2e22d8507602464d4c4b26
-rw-r--r-- | FAQ | 6 | ||||
-rw-r--r-- | INSTALL | 2 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | client.c | 2 | ||||
-rwxr-xr-x | configure | 1 | ||||
-rw-r--r-- | doc/chrony.conf.man.in | 4 | ||||
-rw-r--r-- | doc/chronyc.man.in | 4 | ||||
-rw-r--r-- | doc/chronyd.man.in | 4 | ||||
-rw-r--r-- | doc/faq.adoc | 4 | ||||
-rw-r--r-- | examples/chronyd.service | 2 | ||||
-rw-r--r-- | ntp_io_linux.c | 44 | ||||
-rw-r--r-- | refclock.c | 4 | ||||
-rwxr-xr-x | test/simulation/133-hwtimestamp | 33 | ||||
-rw-r--r-- | version.txt | 2 |
14 files changed, 72 insertions, 42 deletions
@@ -271,6 +271,10 @@ makestep 0.128 -1 maxchange 1000 1 1 maxclockerror 15 +Note that increasing minsamples may cause the offsets in the tracking and +sourcestats reports/logs to be significantly smaller than the actual offsets +and be unsuitable for monitoring. + 2.9. What happened to the commandkey and generatecommandkey directives? They were removed in version 2.2. Authentication is no longer supported in the @@ -544,4 +548,4 @@ needs to be made to work as a service. We have no plans to do this. Anyone is welcome to pick this work up and contribute it back to the project. -Last updated 2019-05-02 11:50:41 CEST +Last updated 2019-05-10 12:22:57 CEST @@ -192,4 +192,4 @@ tar cvf - . | gzip -9 > chrony.tar.gz to build a package. When untarred within the root directory, this will install the files to the intended final locations. -Last updated 2019-05-02 11:50:41 CEST +Last updated 2019-05-10 12:22:57 CEST @@ -4,6 +4,8 @@ New in version 3.5 Enhancements ------------ * Add support for more accurate reading of PHC on Linux 5.0 +* Add support for hardware timestamping on interfaces with read-only + timestamping configuration * Add support for memory locking and real-time priority on FreeBSD, NetBSD, Solaris * Update seccomp filter to work on more architectures @@ -3159,7 +3159,7 @@ static void display_gpl(void) { printf("chrony version %s\n" - "Copyright (C) 1997-2003, 2007, 2009-2018 Richard P. Curnow and others\n" + "Copyright (C) 1997-2003, 2007, 2009-2019 Richard P. Curnow and others\n" "chrony comes with ABSOLUTELY NO WARRANTY. This is free software, and\n" "you are welcome to redistribute it under certain conditions. See the\n" "GNU General Public License version 2 for details.\n\n", @@ -6,6 +6,7 @@ # Copyright (C) Richard P. Curnow 1997-2003 # Copyright (C) Bryan Christianson 2016 # Copyright (C) Miroslav Lichvar 2009, 2012-2018 +# Copyright (C) Stefan R. Filipek 2019 # # ======================================================================= diff --git a/doc/chrony.conf.man.in b/doc/chrony.conf.man.in index c058e8d..46dbbd6 100644 --- a/doc/chrony.conf.man.in +++ b/doc/chrony.conf.man.in @@ -2,12 +2,12 @@ .\" Title: chrony.conf .\" Author: [see the "AUTHORS" section] .\" Generator: Asciidoctor 1.5.6.1 -.\" Date: 2019-05-02 +.\" Date: 2019-05-10 .\" Manual: Configuration Files .\" Source: chrony @CHRONY_VERSION@ .\" Language: English .\" -.TH "CHRONY.CONF" "5" "2019-05-02" "chrony @CHRONY_VERSION@" "Configuration Files" +.TH "CHRONY.CONF" "5" "2019-05-10" "chrony @CHRONY_VERSION@" "Configuration Files" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/doc/chronyc.man.in b/doc/chronyc.man.in index 6ad8e01..6dc9f21 100644 --- a/doc/chronyc.man.in +++ b/doc/chronyc.man.in @@ -2,12 +2,12 @@ .\" Title: chronyc .\" Author: [see the "AUTHORS" section] .\" Generator: Asciidoctor 1.5.6.1 -.\" Date: 2019-05-02 +.\" Date: 2019-05-10 .\" Manual: User manual .\" Source: chrony @CHRONY_VERSION@ .\" Language: English .\" -.TH "CHRONYC" "1" "2019-05-02" "chrony @CHRONY_VERSION@" "User manual" +.TH "CHRONYC" "1" "2019-05-10" "chrony @CHRONY_VERSION@" "User manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/doc/chronyd.man.in b/doc/chronyd.man.in index e346d78..3e21041 100644 --- a/doc/chronyd.man.in +++ b/doc/chronyd.man.in @@ -2,12 +2,12 @@ .\" Title: chronyd .\" Author: [see the "AUTHORS" section] .\" Generator: Asciidoctor 1.5.6.1 -.\" Date: 2019-05-02 +.\" Date: 2019-05-10 .\" Manual: System Administration .\" Source: chrony @CHRONY_VERSION@ .\" Language: English .\" -.TH "CHRONYD" "8" "2019-05-02" "chrony @CHRONY_VERSION@" "System Administration" +.TH "CHRONYD" "8" "2019-05-10" "chrony @CHRONY_VERSION@" "System Administration" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/doc/faq.adoc b/doc/faq.adoc index 318b418..04cdae8 100644 --- a/doc/faq.adoc +++ b/doc/faq.adoc @@ -267,6 +267,10 @@ maxchange 1000 1 1 maxclockerror 15 ---- +Note that increasing `minsamples` may cause the offsets in the `tracking` and +`sourcestats` reports/logs to be significantly smaller than the actual offsets +and be unsuitable for monitoring. + === What happened to the `commandkey` and `generatecommandkey` directives? They were removed in version 2.2. Authentication is no longer supported in the diff --git a/examples/chronyd.service b/examples/chronyd.service index 1777413..289548c 100644 --- a/examples/chronyd.service +++ b/examples/chronyd.service @@ -7,7 +7,7 @@ ConditionCapability=CAP_SYS_TIME [Service] Type=forking -PIDFile=/var/run/chrony/chronyd.pid +PIDFile=/run/chrony/chronyd.pid EnvironmentFile=-/etc/sysconfig/chronyd ExecStart=/usr/sbin/chronyd $OPTIONS PrivateTmp=yes diff --git a/ntp_io_linux.c b/ntp_io_linux.c index eb4a3a8..4e0c800 100644 --- a/ntp_io_linux.c +++ b/ntp_io_linux.c @@ -2,7 +2,7 @@ chronyd/chronyc - Programs for keeping computer clocks accurate. ********************************************************************** - * Copyright (C) Miroslav Lichvar 2016-2018 + * Copyright (C) Miroslav Lichvar 2016-2019 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -123,7 +123,7 @@ add_interface(CNF_HwTsInterface *conf_iface) struct ethtool_ts_info ts_info; struct hwtstamp_config ts_config; struct ifreq req; - int sock_fd, if_index, phc_fd, req_hwts_flags; + int sock_fd, if_index, phc_fd, req_hwts_flags, rx_filter; unsigned int i; struct Interface *iface; @@ -177,40 +177,51 @@ add_interface(CNF_HwTsInterface *conf_iface) return 0; } - ts_config.flags = 0; - ts_config.tx_type = HWTSTAMP_TX_ON; - switch (conf_iface->rxfilter) { case CNF_HWTS_RXFILTER_ANY: #ifdef HAVE_LINUX_TIMESTAMPING_RXFILTER_NTP if (ts_info.rx_filters & (1 << HWTSTAMP_FILTER_NTP_ALL)) - ts_config.rx_filter = HWTSTAMP_FILTER_NTP_ALL; + rx_filter = HWTSTAMP_FILTER_NTP_ALL; else #endif if (ts_info.rx_filters & (1 << HWTSTAMP_FILTER_ALL)) - ts_config.rx_filter = HWTSTAMP_FILTER_ALL; + rx_filter = HWTSTAMP_FILTER_ALL; else - ts_config.rx_filter = HWTSTAMP_FILTER_NONE; + rx_filter = HWTSTAMP_FILTER_NONE; break; case CNF_HWTS_RXFILTER_NONE: - ts_config.rx_filter = HWTSTAMP_FILTER_NONE; + rx_filter = HWTSTAMP_FILTER_NONE; break; #ifdef HAVE_LINUX_TIMESTAMPING_RXFILTER_NTP case CNF_HWTS_RXFILTER_NTP: - ts_config.rx_filter = HWTSTAMP_FILTER_NTP_ALL; + rx_filter = HWTSTAMP_FILTER_NTP_ALL; break; #endif default: - ts_config.rx_filter = HWTSTAMP_FILTER_ALL; + rx_filter = HWTSTAMP_FILTER_ALL; break; } + ts_config.flags = 0; + ts_config.tx_type = HWTSTAMP_TX_ON; + ts_config.rx_filter = rx_filter; req.ifr_data = (char *)&ts_config; if (ioctl(sock_fd, SIOCSHWTSTAMP, &req)) { DEBUG_LOG("ioctl(%s) failed : %s", "SIOCSHWTSTAMP", strerror(errno)); - close(sock_fd); - return 0; + + /* Check the current timestamping configuration in case this interface + allows only reading of the configuration and it was already configured + as requested */ + req.ifr_data = (char *)&ts_config; +#ifdef SIOCGHWTSTAMP + if (ioctl(sock_fd, SIOCGHWTSTAMP, &req) || + ts_config.tx_type != HWTSTAMP_TX_ON || ts_config.rx_filter != rx_filter) +#endif + { + close(sock_fd); + return 0; + } } close(sock_fd); @@ -845,7 +856,12 @@ NIO_Linux_RequestTxTimestamp(struct msghdr *msg, int cmsglen, int sock_fd) /* Add control message that will enable TX timestamping for this message. Don't use CMSG_NXTHDR as the one in glibc is buggy for creating new control messages. */ - cmsg = (struct cmsghdr *)((char *)CMSG_FIRSTHDR(msg) + cmsglen); + + cmsg = CMSG_FIRSTHDR(msg); + if (!cmsg || cmsglen + CMSG_SPACE(sizeof (ts_tx_flags)) > msg->msg_controllen) + return cmsglen; + + cmsg = (struct cmsghdr *)((char *)cmsg + cmsglen); memset(cmsg, 0, CMSG_SPACE(sizeof (ts_tx_flags))); cmsglen += CMSG_SPACE(sizeof (ts_tx_flags)); @@ -2,7 +2,7 @@ chronyd/chronyc - Programs for keeping computer clocks accurate. ********************************************************************** - * Copyright (C) Miroslav Lichvar 2009-2011, 2013-2014, 2016-2018 + * Copyright (C) Miroslav Lichvar 2009-2011, 2013-2014, 2016-2019 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -350,7 +350,7 @@ RCL_CheckDriverOptions(RCL_Instance instance, const char **options) option = get_next_driver_option(instance, option)) { for (i = 0; options && options[i]; i++) { len = strlen(options[i]); - if (!strncmp(options[i], option, strlen(options[i])) && + if (!strncmp(options[i], option, len) && (option[len] == '=' || option[len] == '\0')) break; } diff --git a/test/simulation/133-hwtimestamp b/test/simulation/133-hwtimestamp index 113ea69..229d4ee 100755 --- a/test/simulation/133-hwtimestamp +++ b/test/simulation/133-hwtimestamp @@ -13,22 +13,25 @@ refclock_offset=10.0 min_sync_time=4 max_sync_time=20 limit=200 -client_conf="hwtimestamp eth0" -client_server_options="minpoll 0 maxpoll 0 minsamples 32" +server_conf="hwtimestamp eth0" +client_server_options="minpoll 0 maxpoll 0 minsamples 32 xleave" client_chronyd_options="-d" -run_test || test_fail -check_chronyd_exit || test_fail -check_source_selection || test_fail -check_sync || test_fail - -if check_config_h 'FEAT_DEBUG 1'; then - check_log_messages "HW clock samples" 190 200 || test_fail - check_log_messages "HW clock reset" 0 0 || test_fail - check_log_messages "Received.*tss=1" 1 1 || test_fail - check_log_messages "Received.*tss=2" 390 400 || test_fail - check_log_messages "update_tx_timestamp.*Updated" 50 140 || test_fail - check_log_messages "update_tx_timestamp.*Unacceptable" 50 140 || test_fail -fi +for client_conf in "hwtimestamp eth0" "hwtimestamp eth0 +acquisitionport 123"; do + run_test || test_fail + check_chronyd_exit || test_fail + check_source_selection || test_fail + check_sync || test_fail + + if check_config_h 'FEAT_DEBUG 1'; then + check_log_messages "HW clock samples" 190 200 || test_fail + check_log_messages "HW clock reset" 0 0 || test_fail + check_log_messages "Received.*tss=1" 1 1 || test_fail + check_log_messages "Received.*tss=2" 390 400 || test_fail + check_log_messages "update_tx_timestamp.*Updated" 50 140 || test_fail + check_log_messages "update_tx_timestamp.*Unacceptable" 50 140 || test_fail + fi +done test_pass diff --git a/version.txt b/version.txt index c50661d..5a95802 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.5-pre1 +3.5 |