Hello community, here is the log from the commit of package chrony for openSUSE:Factory checked in at 2016-06-12 18:54:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2016-04-28 16:56:54.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.chrony.new/chrony.changes 2016-06-12 18:54:56.000000000 +0200 @@ -1,0 +2,49 @@ +Wed Jun 8 10:02:51 UTC 2016 - [email protected] + +- update to 2.4: + - Enhancements + - Add orphan option to local directive for orphan mode + compatible with ntpd + - Add distance option to local directive to set activation + threshold (1 second by default) + - Add maxdrift directive to set maximum allowed drift of system + clock + - Try to replace NTP sources exceeding maximum distance + - Randomise source replacement to avoid getting stuck with bad + sources + - Randomise selection of sources from pools on start + - Ignore reference timestamp as ntpd doesn't always set it + correctly + - Modify tracking report to use same values as seen by NTP + clients + - Add -c option to chronyc to write reports in CSV format + - Provide detailed manual pages + - Bug fixes + - Fix SOCK refclock to work correctly when not specified as + last refclock + - Fix initstepslew and -q/-Q options to accept time from own + NTP clients + - Fix authentication with keys using 512-bit hash functions + - Fix crash on exit when multiple signals are received + - Fix conversion of very small floating-point numbers in + command packets + - Removed features + - Drop documentation in Texinfo format +- update clknetsim to a5949fe for fixing a testsuite failure: + - add IP_PKTINFO socket option + - accept environment variables in make + - fix building with FORTIFY_SOURCE + - fix compiler warning + - support multiple SHM refclocks + - fix recv functions with new glibc headers +- refreshed chrony-fix-open.patch: to apply cleanly after clknetsim + update +- drop patches: + - chrony-include-termios.patch + - make-105-ntpauth-more-reliable.patch +- drop buildrequires for texinfo and pre requires on the install + info packages +- no longer use make install-docs: it only installed 0 byte html + files. + +------------------------------------------------------------------- Old: ---- chrony-2.3.tar.gz chrony-include-termios.patch clknetsim-96416d5.tar.gz make-105-ntpauth-more-reliable.patch New: ---- chrony-2.4.tar.gz clknetsim-a5949fe.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ chrony.spec ++++++ --- /var/tmp/diff_new_pack.gSYLlJ/_old 2016-06-12 18:54:57.000000000 +0200 +++ /var/tmp/diff_new_pack.gSYLlJ/_new 2016-06-12 18:54:57.000000000 +0200 @@ -23,10 +23,10 @@ %bcond_with systemd %bcond_with syscallfilter %endif -%global clknetsim_ver 96416d5 +%global clknetsim_ver a5949fe Name: chrony -Version: 2.3 +Version: 2.4 Release: 0 License: GPL-2.0 Summary: System Clock Synchronization Client and Server @@ -47,8 +47,6 @@ # Add NTP servers from DHCP when starting service Patch1: chrony-service-helper.patch Patch2: chrony-logrotate.patch -Patch3: chrony-include-termios.patch -Patch4: make-105-ntpauth-more-reliable.patch Patch5: chrony-fix-open.patch # BuildRequires: NetworkManager-devel @@ -57,7 +55,6 @@ BuildRequires: libedit-devel BuildRequires: mozilla-nss-devel BuildRequires: pkg-config -BuildRequires: texinfo BuildRequires: gcc-c++ # The timezone package is needed for the "make check" tests. It can be # removed if the call to make check is ever deleted. @@ -80,7 +77,6 @@ Requires(pre): %fillup_prereq Requires(pre): %{_sbindir}/groupadd Requires(pre): %{_sbindir}/useradd -Requires(pre): %{install_info_prereq} Provides: ntp-daemon BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -111,8 +107,6 @@ %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 %patch5 -p1 # use our vendor zone (2.*pool.ntp.org names include IPv6 addresses) @@ -140,11 +134,9 @@ --with-sendmail=%{_sbindir}/sendmail make %{?_smp_mflags} all docs -gzip -9 -f -n chrony.txt %install -make %{?_smp_mflags} DESTDIR=%{buildroot} install install-docs -rm "%{buildroot}%{_docdir}/%{name}/%{name}.html" +make %{?_smp_mflags} DESTDIR=%{buildroot} install mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d} mkdir -p %{buildroot}%{_localstatedir}/{lib,log}/chrony @@ -210,13 +202,11 @@ %post %fillup_only %{name} -%install_info --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}" %if %{with systemd} %service_add_post chronyd.service chrony-wait.service %endif %postun -%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}" %if %{with systemd} %service_del_postun chronyd.service chrony-wait.service %else @@ -226,7 +216,7 @@ %files %defattr(-,root,root) -%doc FAQ NEWS README chrony.txt* COPYING +%doc FAQ NEWS README COPYING %doc examples %config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/chrony.conf %config(noreplace) %attr(0640,root,%{name}) %verify(not md5 size mtime) %{_sysconfdir}/chrony.keys @@ -241,7 +231,6 @@ %{_mandir}/man1/chronyc.1%{ext_man} %{_mandir}/man5/chrony.conf.5%{ext_man} %{_mandir}/man8/chronyd.8%{ext_man} -%{_infodir}/chrony.info* %if %{with systemd} %{_prefix}/lib/systemd/ntp-units.d/*.list %{_unitdir}/chrony*.service ++++++ chrony-2.3.tar.gz -> chrony-2.4.tar.gz ++++++ ++++ 18912 lines of diff (skipped) ++++++ chrony-fix-open.patch ++++++ --- /var/tmp/diff_new_pack.gSYLlJ/_old 2016-06-12 18:54:57.000000000 +0200 +++ /var/tmp/diff_new_pack.gSYLlJ/_new 2016-06-12 18:54:57.000000000 +0200 @@ -1,8 +1,8 @@ -Index: chrony-2.3/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/client.c +Index: chrony-2.4/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/client.c =================================================================== ---- chrony-2.3.orig/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/client.c -+++ chrony-2.3/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/client.c -@@ -945,6 +945,8 @@ int open(const char *pathname, int flags +--- chrony-2.4.orig/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/client.c ++++ chrony-2.4/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/client.c +@@ -954,6 +954,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)); -@@ -963,6 +965,8 @@ int close(int fd) { +@@ -972,6 +974,8 @@ int close(int fd) { return 0; } ++++++ clknetsim-96416d5.tar.gz -> clknetsim-a5949fe.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/Makefile new/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/Makefile --- old/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/Makefile 2016-03-14 17:33:24.000000000 +0100 +++ new/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/Makefile 2016-06-08 11:20:13.000000000 +0200 @@ -1,7 +1,7 @@ -CC=gcc -CXX=g++ -CFLAGS=-O2 -Wall -g -fPIC -CXXFLAGS=$(CFLAGS) +CC ?= gcc +CXX ?= g++ +CFLAGS += -O2 -Wall -g -fPIC +CXXFLAGS += $(CFLAGS) all: clknetsim.so clknetsim diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/client.c new/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/client.c --- old/clknetsim-96416d5d0bb6f8c2356fa067f707f34fc650688c/client.c 2016-03-14 17:33:24.000000000 +0100 +++ new/clknetsim-a5949fedf7e0f78a756bd29fe93fa1e4f72cdc42/client.c 2016-06-08 11:20:13.000000000 +0200 @@ -116,6 +116,7 @@ int remote_node; int remote_port; int broadcast; + int pkt_info; int time_stamping; }; @@ -144,7 +145,8 @@ static timer_t itimer_real_id; -#define SHMKEY 0x4e545030 +#define SHM_KEY 0x4e545030 +#define SHM_REFCLOCKS 4 static struct shmTime { int mode; @@ -160,10 +162,10 @@ int clockTimeStampNSec; int receiveTimeStampNSec; int dummy[8]; -} shm_time; +} shm_time[SHM_REFCLOCKS]; -static int refclock_shm_enabled = 0; -static double refclock_time = 0.0; +static int shm_refclocks = 0; +static double shm_refclock_time = 0.0; static struct Reply_getrefoffsets refclock_offsets; static int refclock_offsets_used = REPLY_GETREFOFFSETS_SIZE; @@ -317,13 +319,17 @@ return monotonic_time; } -static double get_refclock_time(void) { - fetch_time(); +static double get_refclock_offset(void) { if (refclock_offsets_used >= REPLY_GETREFOFFSETS_SIZE) { make_request(REQ_GETREFOFFSETS, NULL, 0, &refclock_offsets, sizeof (refclock_offsets)); refclock_offsets_used = 0; } - return network_time - refclock_offsets.offsets[refclock_offsets_used++]; + return refclock_offsets.offsets[refclock_offsets_used++]; +} + +static double get_refclock_time(void) { + fetch_time(); + return network_time - get_refclock_offset(); } static void settime(double time) { @@ -338,34 +344,37 @@ static void fill_refclock_sample(void) { struct Reply_getrefsample r; double clock_time, receive_time, round_corr; + int i; - if (!refclock_shm_enabled) + if (!shm_refclocks) return; make_request(REQ_GETREFSAMPLE, NULL, 0, &r, sizeof (r)); - if (r.time == refclock_time || !r.valid) + if (r.time == shm_refclock_time || !r.valid) return; - refclock_time = r.time; + shm_refclock_time = r.time; - clock_time = r.time - r.offset; - receive_time = r.time; - - round_corr = (clock_time * 1e6 - floor(clock_time * 1e6) + 0.5) / 1e6; - clock_time -= round_corr; - receive_time -= round_corr; - - shm_time.count++; - shm_time.clockTimeStampSec = floor(clock_time); - shm_time.clockTimeStampUSec = (clock_time - shm_time.clockTimeStampSec) * 1e6; - shm_time.clockTimeStampNSec = (clock_time - shm_time.clockTimeStampSec) * 1e9; - shm_time.clockTimeStampSec += system_time_offset; - shm_time.receiveTimeStampSec = floor(receive_time); - shm_time.receiveTimeStampUSec = (receive_time - shm_time.receiveTimeStampSec) * 1e6; - shm_time.receiveTimeStampNSec = (receive_time - shm_time.receiveTimeStampSec) * 1e9; - shm_time.receiveTimeStampSec += system_time_offset; - shm_time.leap = 0; - shm_time.valid = 1; + for (i = 0; i < shm_refclocks; i++) { + clock_time = r.time - (i > 0 ? get_refclock_offset() : r.offset); + receive_time = r.time; + + round_corr = (clock_time * 1e6 - floor(clock_time * 1e6) + 0.5) / 1e6; + clock_time -= round_corr; + receive_time -= round_corr; + + shm_time[i].count++; + shm_time[i].clockTimeStampSec = floor(clock_time); + shm_time[i].clockTimeStampUSec = (clock_time - shm_time[i].clockTimeStampSec) * 1e6; + shm_time[i].clockTimeStampNSec = (clock_time - shm_time[i].clockTimeStampSec) * 1e9; + shm_time[i].clockTimeStampSec += system_time_offset; + shm_time[i].receiveTimeStampSec = floor(receive_time); + shm_time[i].receiveTimeStampUSec = (receive_time - shm_time[i].receiveTimeStampSec) * 1e6; + shm_time[i].receiveTimeStampNSec = (receive_time - shm_time[i].receiveTimeStampSec) * 1e9; + shm_time[i].receiveTimeStampSec += system_time_offset; + shm_time[i].leap = 0; + shm_time[i].valid = 1; + } } static int socket_in_subnet(int socket, int subnet) { @@ -863,7 +872,7 @@ return r; } -int __poll_chk(struct pollfd *fds, nfds_t nfds, int timeout) { +int __poll_chk(struct pollfd *fds, nfds_t nfds, int timeout, size_t fdslen) { return poll(fds, nfds, timeout); } @@ -1102,6 +1111,8 @@ return -1; } } + 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)) sockets[s].time_stamping = !!(int *)optval; @@ -1334,7 +1345,8 @@ ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags) { struct Reply_recv rep; struct sockaddr_in *sa; - int msglen, s = get_socket_from_fd(sockfd); + struct cmsghdr *cmsg; + int msglen, cmsglen, s = get_socket_from_fd(sockfd); if (sockfd == clknetsim_fd) return _recvmsg(sockfd, msg, flags); @@ -1376,29 +1388,48 @@ msglen = msg->msg_iov[0].iov_len < rep.len ? msg->msg_iov[0].iov_len : rep.len; memcpy(msg->msg_iov[0].iov_base, rep.data, msglen); + cmsglen = 0; + + if (sockets[s].pkt_info) { + struct in_pktinfo ipi; + + cmsglen = CMSG_SPACE(sizeof (ipi)); + assert(msg->msg_control && msg->msg_controllen >= cmsglen); + + cmsg = CMSG_FIRSTHDR(msg); + memset(cmsg, 0, sizeof (*cmsg)); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_PKTINFO; + cmsg->cmsg_len = cmsglen; + + memset(&ipi, 0, sizeof (ipi)); + ipi.ipi_spec_dst.s_addr = htonl(NODE_ADDR(sockets[s].iface - IFACE_ETH0, node)); + + memcpy(CMSG_DATA(cmsg), &ipi, sizeof (ipi)); + } + #ifdef SO_TIMESTAMPING if (sockets[s].time_stamping) { struct timespec ts; - struct cmsghdr *cmsg; - int len = CMSG_SPACE(3 * sizeof (struct timespec)); - - clock_gettime(CLOCK_REALTIME, &ts); - assert(msg->msg_control && msg->msg_controllen >= len); + assert(!cmsglen); + cmsglen = CMSG_SPACE(3 * sizeof (ts)); + assert(msg->msg_control && msg->msg_controllen >= cmsglen); cmsg = CMSG_FIRSTHDR(msg); + memset(cmsg, 0, sizeof (*cmsg)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SO_TIMESTAMPING; - cmsg->cmsg_len = len; + cmsg->cmsg_len = cmsglen; + + clock_gettime(CLOCK_REALTIME, &ts); /* copy as sw and hw time stamp */ memcpy((struct timespec *)CMSG_DATA(cmsg), &ts, sizeof (ts)); memcpy((struct timespec *)CMSG_DATA(cmsg) + 2, &ts, sizeof (ts)); - - msg->msg_controllen = len; - } else + } #endif - msg->msg_controllen = 0; + msg->msg_controllen = cmsglen; return msglen; } @@ -1411,6 +1442,9 @@ iov.iov_base = (void *)buf; iov.iov_len = len; + /* needed for compatibility with old glibc recvmsg() */ + memset(&msg, 0, sizeof (msg)); + msg.msg_name = (void *)src_addr; msg.msg_namelen = *addrlen; msg.msg_iov = &iov; @@ -1574,8 +1608,8 @@ if (fuzz_mode) return _shmget(key, size, shmflg); - if (key == SHMKEY) - return SHMKEY; + if (key >= SHM_KEY && key < SHM_KEY + SHM_REFCLOCKS) + return key; return -1; } @@ -1584,19 +1618,19 @@ if (fuzz_mode) return _shmat(shmid, shmaddr, shmflg); - assert(shmid == SHMKEY); + assert(shmid >= SHM_KEY && shmid < SHM_KEY + SHM_REFCLOCKS); - refclock_shm_enabled = 1; - memset(&shm_time, 0, sizeof (shm_time)); - shm_time.mode = 1; - shm_time.precision = -20; + if (shm_refclocks < shmid - SHM_KEY + 1) + shm_refclocks = shmid - SHM_KEY + 1; + memset(&shm_time[shmid - SHM_KEY], 0, sizeof (shm_time[0])); + shm_time[shmid - SHM_KEY].mode = 1; + shm_time[shmid - SHM_KEY].precision = -20; - return &shm_time; + return &shm_time[shmid - SHM_KEY]; } int shmdt(const void *shmaddr) { - assert(shmaddr == &shm_time); - refclock_shm_enabled = 0; + assert(shmaddr >= (void *)&shm_time[0] && shmaddr < (void *)&shm_time[SHM_REFCLOCKS]); return 0; } @@ -1673,7 +1707,8 @@ if (random_seed) { seed = random_seed + node; } else if ((f = _fopen("/dev/urandom", "r"))) { - fread(&seed, sizeof (seed), 1, f); + if (fread(&seed, sizeof (seed), 1, f) != 1) + ; fclose(f); } _srandom(seed);
