Hello community, here is the log from the commit of package chrony for openSUSE:Factory checked in at 2017-02-02 15:42:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/chrony (Old) and /work/SRC/openSUSE:Factory/.chrony.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "chrony" Changes: -------- --- /work/SRC/openSUSE:Factory/chrony/chrony.changes 2017-01-23 11:37:04.328581562 +0100 +++ /work/SRC/openSUSE:Factory/.chrony.new/chrony.changes 2017-02-03 17:34:37.310851211 +0100 @@ -1,0 +2,18 @@ +Tue Jan 31 16:38:05 UTC 2017 - mp...@suse.com + +- Upgraded to version 3.1: + - Enhancements + - Add support for precise cross timestamping of PHC on Linux + - Add minpoll, precision, nocrossts options to hwtimestamp directive + - Add rawmeasurements option to log directive and modify measurements + option to log only valid measurements from synchronised sources + - Allow sub-second polling interval with NTP sources + - Bug fixes + - Fix time smoothing in interleaved mode +- Upgraded clknetsim to version ce89a1b. +- Reworked the following patches to fit the new versions + - chrony-config.patch + - chrony-service-helper.patch + - chrony-fix-open.patch + +------------------------------------------------------------------- Old: ---- chrony-3.0.tar.gz clknetsim-6bb6519.tar.gz New: ---- chrony-3.1.tar.gz clknetsim-ce89a1b.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ chrony.spec ++++++ --- /var/tmp/diff_new_pack.WJPlHp/_old 2017-02-03 17:34:37.918765169 +0100 +++ /var/tmp/diff_new_pack.WJPlHp/_new 2017-02-03 17:34:37.922764603 +0100 @@ -17,6 +17,7 @@ %define vendorzone opensuse. +%global clknetsim_ver ce89a1b %if 0%{?suse_version} > 1230 %bcond_without systemd %bcond_without syscallfilter @@ -24,10 +25,8 @@ %bcond_with systemd %bcond_with syscallfilter %endif -%global clknetsim_ver 6bb6519 - Name: chrony -Version: 3.0 +Version: 3.1 Release: 0 Summary: System Clock Synchronization Client and Server License: GPL-2.0 @@ -42,7 +41,6 @@ Source6: chrony-dnssrv@.timer # Simulator for test suite Source10: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz - # PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch0: chrony-config.patch # Add NTP servers from DHCP when starting service @@ -56,11 +54,16 @@ BuildRequires: libcap-devel BuildRequires: libedit-devel BuildRequires: mozilla-nss-devel -BuildRequires: pkg-config +BuildRequires: pkgconfig # The timezone package is needed for the "make check" tests. It can be # removed if the call to make check is ever deleted. BuildRequires: timezone - +Requires: logrotate +Requires(pre): %fillup_prereq +Requires(pre): %{_sbindir}/groupadd +Requires(pre): %{_sbindir}/useradd +Provides: ntp-daemon +BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{with syscallfilter} %ifarch s390 s390x ppc64le BuildRequires: libseccomp-devel >= 2.2.0 @@ -74,12 +77,6 @@ %else Requires(pre): %insserv_prereq %endif -Requires: logrotate -Requires(pre): %fillup_prereq -Requires(pre): %{_sbindir}/groupadd -Requires(pre): %{_sbindir}/useradd -Provides: ntp-daemon -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Chrony is an implementation of the Network Time Protocol (NTP). It can @@ -164,8 +161,8 @@ %{buildroot}%{_unitdir}/chrony-wait.service install -m 644 -p %{SOURCE5} %{buildroot}%{_unitdir}/chrony-dnssrv@.service install -m 644 -p %{SOURCE6} %{buildroot}%{_unitdir}/chrony-dnssrv@.timer -ln -s /usr/sbin/service "%{buildroot}%{_sbindir}/rcchronyd" -ln -s /usr/sbin/service "%{buildroot}%{_sbindir}/rcchrony-wait" +ln -s %{_sbindir}/service "%{buildroot}%{_sbindir}/rcchronyd" +ln -s %{_sbindir}/service "%{buildroot}%{_sbindir}/rcchrony-wait" echo 'chronyd.service' > \ %{buildroot}%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list ++++++ chrony-3.0.tar.gz -> chrony-3.1.tar.gz ++++++ ++++ 2647 lines of diff (skipped) ++++++ chrony-config.patch ++++++ --- /var/tmp/diff_new_pack.WJPlHp/_old 2017-02-03 17:34:38.070743658 +0100 +++ /var/tmp/diff_new_pack.WJPlHp/_new 2017-02-03 17:34:38.074743092 +0100 @@ -1,7 +1,5 @@ -Index: chrony-2.3/examples/chrony.conf.example3 -=================================================================== ---- chrony-2.3.orig/examples/chrony.conf.example3 -+++ chrony-2.3/examples/chrony.conf.example3 +--- chrony-3.1/examples/chrony.conf.example3 2017-01-31 05:22:11.000000000 -0500 ++++ chrony-3.1/examples/chrony.conf.example3 2017-01-31 11:53:04.000000000 -0500 @@ -27,12 +27,38 @@ # you can access at http://support.ntp.org/bin/view/Servers/WebHome or # you can use servers from the pool.ntp.org project. @@ -11,8 +9,7 @@ -! server baz.example.net iburst - ! pool pool.ntp.org iburst -- -+ + +# for Europe: +! server 0.europe.pool.ntp.org +! server 1.europe.pool.ntp.org @@ -43,10 +40,10 @@ +! server 2.oceania.pool.ntp.org +! server 3.oceania.pool.ntp.org + - # However, for dial-up use you probably want these instead. The word - # 'offline' means that the server is not visible at boot time. Use - # chronyc's 'online' command to tell chronyd that these servers have -@@ -77,7 +103,7 @@ + ####################################################################### + ### AVOIDING POTENTIALLY BOGUS CHANGES TO YOUR CLOCK + # +@@ -65,7 +91,7 @@ # immediately so that it doesn't gain or lose any more time. You # generally want this, so it is uncommented. @@ -55,7 +52,7 @@ # If you want to enable NTP authentication with symmetric keys, you will need # to uncomment the following line and edit the file to set up the keys. -@@ -130,8 +156,8 @@ driftfile /var/lib/chrony/drift +@@ -118,8 +144,8 @@ # produce some graphs of your system's timekeeping performance, or you # need help in debugging a problem. ++++++ chrony-fix-open.patch ++++++ --- /var/tmp/diff_new_pack.WJPlHp/_old 2017-02-03 17:34:38.106738564 +0100 +++ /var/tmp/diff_new_pack.WJPlHp/_new 2017-02-03 17:34:38.106738564 +0100 @@ -1,8 +1,8 @@ -Index: chrony-3.0/clknetsim-6bb6519590ebf43a61f2c11442da525a1950b7df/client.c +Index: chrony-3.1/clknetsim-ce89a1b4e361c432ba3541548008ef0a87bd7fdb/client.c =================================================================== ---- chrony-3.0/clknetsim-6bb6519590ebf43a61f2c11442da525a1950b7df/client.c -+++ chrony-3.0/clknetsim-6bb6519590ebf43a61f2c11442da525a1950b7df/client.c -@@ -954,6 +954,8 @@ int open(const char *pathname, int flags +--- chrony-3.1/clknetsim-ce89a1b4e361c432ba3541548008ef0a87bd7fdb/client.c ++++ chrony-3.1/clknetsim-ce89a1b4e361c432ba3541548008ef0a87bd7fdb/client.c +@@ -1000,6 +1000,8 @@ int open(const char *pathname, int flags else if (!strcmp(pathname, "/dev/ptp1")) return SYSCLK_FD; @@ -11,7 +11,7 @@ r = _open(pathname, flags); assert(r < 0 || (r < BASE_SOCKET_FD && r < BASE_TIMER_FD)); -@@ -972,6 +974,8 @@ int close(int fd) { +@@ -1018,6 +1020,8 @@ int close(int fd) { return 0; } ++++++ chrony-service-helper.patch ++++++ --- /var/tmp/diff_new_pack.WJPlHp/_old 2017-02-03 17:34:38.126735734 +0100 +++ /var/tmp/diff_new_pack.WJPlHp/_new 2017-02-03 17:34:38.126735734 +0100 @@ -1,12 +1,10 @@ -Index: chrony-2.3/examples/chronyd.service -=================================================================== ---- chrony-2.3.orig/examples/chronyd.service -+++ chrony-2.3/examples/chronyd.service -@@ -8,6 +8,7 @@ Type=forking +--- chrony-3.1/examples/chronyd.service 2017-01-31 05:22:11.000000000 -0500 ++++ chrony-3.1/examples/chronyd.service 2017-01-31 12:00:01.000000000 -0500 +@@ -10,6 +10,7 @@ PIDFile=/var/run/chronyd.pid EnvironmentFile=-/etc/sysconfig/chronyd ExecStart=/usr/sbin/chronyd $OPTIONS +ExecStartPost=/usr/share/chrony-helper update-daemon - - [Install] - WantedBy=multi-user.target + PrivateTmp=yes + ProtectHome=yes + ProtectSystem=full ++++++ clknetsim-6bb6519.tar.gz -> clknetsim-ce89a1b.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clknetsim-6bb6519590ebf43a61f2c11442da525a1950b7df/client.c new/clknetsim-ce89a1b4e361c432ba3541548008ef0a87bd7fdb/client.c --- old/clknetsim-6bb6519590ebf43a61f2c11442da525a1950b7df/client.c 2016-12-13 17:25:43.000000000 +0100 +++ new/clknetsim-ce89a1b4e361c432ba3541548008ef0a87bd7fdb/client.c 2017-01-24 14:49:02.000000000 +0100 @@ -102,6 +102,7 @@ static int precision_hack = 1; static unsigned int random_seed = 0; static int recv_multiply = 1; +static int timestamping = 1; enum { IFACE_NONE = 0, @@ -125,6 +126,15 @@ static struct socket sockets[MAX_SOCKETS]; static int subnets; +struct ts_msg { + char data[MAX_PACKET_SIZE]; + int len; + int subnet; + int to; + int port; + int sockfd; +} last_ts_msg; + static double real_time = 0.0; static double monotonic_time = 0.0; static double network_time = 0.0; @@ -211,6 +221,10 @@ if (env) recv_multiply = atoi(env); + env = getenv("CLKNETSIM_TIMESTAMPING"); + if (env) + timestamping = atoi(env); + if (fuzz_init()) { node = 0; subnets = 1; @@ -703,8 +717,21 @@ if (writefds) FD_ZERO(writefds); - if (exceptfds) + + if (exceptfds) { + /* chronyd waiting for TX timestamp from the error queue */ + for (i = 0; i < nfds; i++) { + if (!FD_ISSET(i, exceptfds) || i != last_ts_msg.sockfd) + continue; + if (readfds) + FD_ZERO(readfds); + FD_ZERO(exceptfds); + FD_SET(i, exceptfds); + return 1; + } + FD_ZERO(exceptfds); + } req.read = 0; req._pad = 0; @@ -1133,8 +1160,13 @@ else if (level == IPPROTO_IP && optname == IP_PKTINFO && optlen == sizeof (int)) sockets[s].pkt_info = !!(int *)optval; #ifdef SO_TIMESTAMPING - else if (level == SOL_SOCKET && optname == SO_TIMESTAMPING && optlen == sizeof (int)) + else if (level == SOL_SOCKET && optname == SO_TIMESTAMPING && optlen == sizeof (int)) { + if (!timestamping) { + errno = EINVAL; + return -1; + } sockets[s].time_stamping = !!(int *)optval; + } #endif /* unhandled options succeed too */ @@ -1337,6 +1369,18 @@ make_request(REQ_SEND, &req, offsetof(struct Request_send, data) + req.len, NULL, 0); + if (sockets[s].time_stamping) { + assert(req.len <= sizeof (last_ts_msg.data)); + memcpy(last_ts_msg.data, req.data, req.len); + last_ts_msg.len = req.len; + last_ts_msg.subnet = req.subnet; + last_ts_msg.to = req.to; + last_ts_msg.port = req.dst_port; + last_ts_msg.sockfd = sockfd; + } else { + last_ts_msg.sockfd = -1; + } + return req.len; } @@ -1413,15 +1457,36 @@ assert(s >= 0 && sockets[s].type == SOCK_DGRAM); - if (sockets[s].time_stamping && flags == MSG_ERRQUEUE) { - /* dummy message for tx time stamp */ - assert(sockets[s].iface >= IFACE_ETH0); - rep.subnet = sockets[s].iface - IFACE_ETH0; - rep.from = node; - rep.src_port = sockets[s].remote_port; + if (sockets[s].time_stamping && flags & MSG_ERRQUEUE) { + uint32_t addr; + uint16_t port; + + /* last message looped back to the error queue */ + + assert(sockfd == last_ts_msg.sockfd); + last_ts_msg.sockfd = -1; + msg->msg_flags = MSG_ERRQUEUE; + + rep.subnet = last_ts_msg.subnet; + rep.from = last_ts_msg.to; + rep.src_port = last_ts_msg.port; rep.dst_port = sockets[s].port; - rep.len = 1; - rep.data[0] = 0; + + addr = htonl(NODE_ADDR(rep.subnet, rep.from)); + port = htons(rep.src_port); + + /* put the message in an Ethernet frame */ + memset(rep.data, 0, 42); + rep.data[12] = 0x08; + rep.data[14] = 0x45; + rep.data[23] = 17; + memcpy(rep.data + 30, &addr, sizeof (addr)); + memcpy(rep.data + 36, &port, sizeof (port)); + + assert(last_ts_msg.len + 42 <= sizeof (rep.data)); + memcpy(rep.data + 42, last_ts_msg.data, last_ts_msg.len); + + rep.len = 42 + last_ts_msg.len; } else make_request(REQ_RECV, NULL, 0, &rep, sizeof (rep));