Hello community,

here is the log from the commit of package chrony for openSUSE:Factory checked 
in at 2016-12-01 10:28:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-06-12 
18:54:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.chrony.new/chrony.changes       2016-12-01 
10:28:48.000000000 +0100
@@ -1,0 +2,10 @@
+Tue Nov 29 16:54:52 UTC 2016 - mp...@suse.com
+
+- Upgraded to version 2.4.1:
+  - Bug fixes
+    - Fix processing of kernel timestamps on non-Linux systems
+    - Fix crash with smoothtime directive
+    - Fix validation of refclock sample times
+    - Fix parsing of refclock directive
+
+-------------------------------------------------------------------

Old:
----
  chrony-2.4.tar.gz

New:
----
  chrony-2.4.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ chrony.spec ++++++
--- /var/tmp/diff_new_pack.QzBevW/_old  2016-12-01 10:28:49.000000000 +0100
+++ /var/tmp/diff_new_pack.QzBevW/_new  2016-12-01 10:28:49.000000000 +0100
@@ -11,10 +11,11 @@
 # case the license is the MIT License). An "Open Source License" is a
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
-#
+
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 %define vendorzone opensuse.
 %if 0%{?suse_version} > 1230
 %bcond_without  systemd
@@ -26,10 +27,10 @@
 %global clknetsim_ver a5949fe
 
 Name:           chrony
-Version:        2.4
+Version:        2.4.1
 Release:        0
-License:        GPL-2.0
 Summary:        System Clock Synchronization Client and Server
+License:        GPL-2.0
 Group:          Productivity/Networking/Other
 Url:            http://chrony.tuxfamily.org/
 Source:         http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
@@ -51,11 +52,11 @@
 #
 BuildRequires:  NetworkManager-devel
 BuildRequires:  bison
+BuildRequires:  gcc-c++
 BuildRequires:  libcap-devel
 BuildRequires:  libedit-devel
 BuildRequires:  mozilla-nss-devel
 BuildRequires:  pkg-config
-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.
 BuildRequires:  timezone

++++++ chrony-2.4.tar.gz -> chrony-2.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/FAQ new/chrony-2.4.1/FAQ
--- old/chrony-2.4/FAQ  2016-06-07 11:27:25.000000000 +0200
+++ new/chrony-2.4.1/FAQ        2016-11-21 12:10:57.000000000 +0100
@@ -406,4 +406,4 @@
 We have no plans to do this. Anyone is welcome to pick this work up and
 contribute it back to the project.
 
-Last updated 2016-06-07 11:20:59 CEST
+Last updated 2016-11-21 12:03:45 CET
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/INSTALL new/chrony-2.4.1/INSTALL
--- old/chrony-2.4/INSTALL      2016-06-07 11:27:25.000000000 +0200
+++ new/chrony-2.4.1/INSTALL    2016-11-21 12:10:57.000000000 +0100
@@ -147,4 +147,4 @@
 to build a package. When untarred within the root directory, this will install
 the files to the intended final locations.
 
-Last updated 2016-06-07 11:20:59 CEST
+Last updated 2016-11-21 12:03:45 CET
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/NEWS new/chrony-2.4.1/NEWS
--- old/chrony-2.4/NEWS 2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/NEWS       2016-11-21 12:03:45.000000000 +0100
@@ -1,3 +1,13 @@
+New in version 2.4.1
+====================
+
+Bug fixes
+---------
+* Fix processing of kernel timestamps on non-Linux systems
+* Fix crash with smoothtime directive
+* Fix validation of refclock sample times
+* Fix parsing of refclock directive
+
 New in version 2.4
 ==================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/client.c new/chrony-2.4.1/client.c
--- old/chrony-2.4/client.c     2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/client.c   2016-11-21 12:03:45.000000000 +0100
@@ -125,6 +125,7 @@
     return( line );
 #else
     printf("%s", prompt);
+    fflush(stdout);
 #endif
   }
   if (fgets(line, sizeof(line), stdin)) {
@@ -2007,7 +2008,7 @@
     print_report("%c%c %-27s  %2d  %2d   %3o  %I  %+S[%+S] +/- %S\n",
                  mode_ch, state_ch, name,
                  ntohs(reply.data.source_data.stratum),
-                 ntohs(reply.data.source_data.poll),
+                 (int16_t)ntohs(reply.data.source_data.poll),
                  ntohs(reply.data.source_data.reachability),
                  (unsigned long)ntohl(reply.data.source_data.since_sample),
                  UTI_FloatNetworkToHost(reply.data.source_data.latest_meas),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/conf.c new/chrony-2.4.1/conf.c
--- old/chrony-2.4/conf.c       2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/conf.c     2016-11-21 12:03:45.000000000 +0100
@@ -696,9 +696,9 @@
   line = CPS_SplitWord(line);
   param = Strdup(p);
 
-  while (*line) {
-    cmd = line;
+  for (cmd = line; *cmd; line += n, cmd = line) {
     line = CPS_SplitWord(line);
+
     if (!strcasecmp(cmd, "refid")) {
       if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
         break;
@@ -756,10 +756,9 @@
       other_parse_error("Invalid refclock option");
       return;
     }
-    line += n;
   }
 
-  if (*line) {
+  if (*cmd) {
     command_parse_error();
     return;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/doc/chrony.conf.man.in 
new/chrony-2.4.1/doc/chrony.conf.man.in
--- old/chrony-2.4/doc/chrony.conf.man.in       2016-06-07 11:27:24.000000000 
+0200
+++ new/chrony-2.4.1/doc/chrony.conf.man.in     2016-11-21 12:10:57.000000000 
+0100
@@ -2,12 +2,12 @@
 .\"     Title: chrony.conf
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: Asciidoctor 1.5.4
-.\"      Date: 2016-06-07
+.\"      Date: 2016-11-21
 .\"    Manual: Configuration Files
 .\"    Source: chrony @CHRONY_VERSION@
 .\"  Language: English
 .\"
-.TH "CHRONY.CONF" "5" "2016-06-07" "chrony @CHRONY_VERSION@" "Configuration 
Files"
+.TH "CHRONY.CONF" "5" "2016-11-21" "chrony @CHRONY_VERSION@" "Configuration 
Files"
 .ie \n(.g .ds Aq \(aq
 .el       .ds Aq '
 .ss \n[.ss] 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/doc/chronyc.man.in 
new/chrony-2.4.1/doc/chronyc.man.in
--- old/chrony-2.4/doc/chronyc.man.in   2016-06-07 11:27:25.000000000 +0200
+++ new/chrony-2.4.1/doc/chronyc.man.in 2016-11-21 12:10:57.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: chronyc
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: Asciidoctor 1.5.4
-.\"      Date: 2016-06-07
+.\"      Date: 2016-11-21
 .\"    Manual: User manual
 .\"    Source: chrony @CHRONY_VERSION@
 .\"  Language: English
 .\"
-.TH "CHRONYC" "1" "2016-06-07" "chrony @CHRONY_VERSION@" "User manual"
+.TH "CHRONYC" "1" "2016-11-21" "chrony @CHRONY_VERSION@" "User manual"
 .ie \n(.g .ds Aq \(aq
 .el       .ds Aq '
 .ss \n[.ss] 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/doc/chronyd.man.in 
new/chrony-2.4.1/doc/chronyd.man.in
--- old/chrony-2.4/doc/chronyd.man.in   2016-06-07 11:27:25.000000000 +0200
+++ new/chrony-2.4.1/doc/chronyd.man.in 2016-11-21 12:10:57.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: chronyd
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: Asciidoctor 1.5.4
-.\"      Date: 2016-06-07
+.\"      Date: 2016-11-21
 .\"    Manual: System Administration
 .\"    Source: chrony @CHRONY_VERSION@
 .\"  Language: English
 .\"
-.TH "CHRONYD" "8" "2016-06-07" "chrony @CHRONY_VERSION@" "System 
Administration"
+.TH "CHRONYD" "8" "2016-11-21" "chrony @CHRONY_VERSION@" "System 
Administration"
 .ie \n(.g .ds Aq \(aq
 .el       .ds Aq '
 .ss \n[.ss] 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/examples/chrony.spec 
new/chrony-2.4.1/examples/chrony.spec
--- old/chrony-2.4/examples/chrony.spec 2016-06-07 11:27:24.000000000 +0200
+++ new/chrony-2.4.1/examples/chrony.spec       2016-11-21 12:10:55.000000000 
+0100
@@ -1,4 +1,4 @@
-%global chrony_version 2.4
+%global chrony_version 2.4.1
 %if 0%(echo %{chrony_version} | grep -q pre && echo 1)
 %global prerelease %(echo %{chrony_version} | sed 's/.*-//')
 %endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/ntp_io.c new/chrony-2.4.1/ntp_io.c
--- old/chrony-2.4/ntp_io.c     2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/ntp_io.c   2016-11-21 12:03:45.000000000 +0100
@@ -556,7 +556,7 @@
 #endif
 
 #ifdef SO_TIMESTAMP
-      if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SO_TIMESTAMP) {
+      if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP) {
         struct timeval tv;
 
         memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/refclock.c new/chrony-2.4.1/refclock.c
--- old/chrony-2.4/refclock.c   2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/refclock.c 2016-11-21 12:03:45.000000000 +0100
@@ -92,7 +92,7 @@
 
 static LOG_FileID logfileid;
 
-static int valid_sample_time(RCL_Instance instance, struct timeval *tv);
+static int valid_sample_time(RCL_Instance instance, struct timeval *raw, 
struct timeval *cooked);
 static int pps_stratum(RCL_Instance instance, struct timeval *tv);
 static void poll_timeout(void *arg);
 static void slew_samples(struct timeval *raw, struct timeval *cooked, double 
dfreq,
@@ -106,6 +106,7 @@
 static double filter_get_avg_sample_dispersion(struct MedianFilter *filter);
 static void filter_add_sample(struct MedianFilter *filter, struct timeval 
*sample_time, double offset, double dispersion);
 static int filter_get_last_sample(struct MedianFilter *filter, struct timeval 
*sample_time, double *offset, double *dispersion);
+static int filter_get_samples(struct MedianFilter *filter);
 static int filter_select_samples(struct MedianFilter *filter);
 static int filter_get_sample(struct MedianFilter *filter, struct timeval 
*sample_time, double *offset, double *dispersion);
 static void filter_slew_samples(struct MedianFilter *filter, struct timeval 
*when, double dfreq, double doffset);
@@ -372,7 +373,7 @@
 
   /* Make sure the timestamp and offset provided by the driver are sane */
   if (!UTI_IsTimeOffsetSane(sample_time, offset) ||
-      !valid_sample_time(instance, sample_time))
+      !valid_sample_time(instance, sample_time, &cooked_time))
     return 0;
 
   switch (leap) {
@@ -412,7 +413,7 @@
   dispersion += instance->precision;
 
   if (!UTI_IsTimeOffsetSane(pulse_time, 0.0) ||
-      !valid_sample_time(instance, pulse_time))
+      !valid_sample_time(instance, pulse_time, &cooked_time))
     return 0;
 
   rate = instance->pps_rate;
@@ -503,18 +504,25 @@
 }
 
 static int
-valid_sample_time(RCL_Instance instance, struct timeval *tv)
+valid_sample_time(RCL_Instance instance, struct timeval *raw, struct timeval 
*cooked)
 {
-  struct timeval raw_time;
-  double diff;
+  struct timeval raw_time, last_sample_time;
+  double diff, last_offset, last_dispersion;
 
   LCL_ReadRawTime(&raw_time);
-  UTI_DiffTimevalsToDouble(&diff, &raw_time, tv);
-  if (diff < 0.0 || diff > UTI_Log2ToDouble(instance->poll + 1)) {
-    DEBUG_LOG(LOGF_Refclock, "%s refclock sample not valid age=%.6f tv=%s",
-        UTI_RefidToString(instance->ref_id), diff, UTI_TimevalToString(tv));
+  UTI_DiffTimevalsToDouble(&diff, &raw_time, raw);
+
+  if (diff < 0.0 || diff > UTI_Log2ToDouble(instance->poll + 1) ||
+      (filter_get_samples(&instance->filter) > 0 &&
+       filter_get_last_sample(&instance->filter, &last_sample_time,
+                              &last_offset, &last_dispersion) &&
+       UTI_CompareTimevals(&last_sample_time, cooked) >= 0)) {
+    DEBUG_LOG(LOGF_Refclock, "%s refclock sample not valid age=%.6f raw=%s 
cooked=%s",
+              UTI_RefidToString(instance->ref_id), diff,
+              UTI_TimevalToString(raw), UTI_TimevalToString(cooked));
     return 0;
   }
+
   return 1;
 }
 
@@ -719,6 +727,12 @@
   return 1;
 }
 
+static int
+filter_get_samples(struct MedianFilter *filter)
+{
+  return filter->used;
+}
+
 static const struct FilterSample *tmp_sorted_array;
 
 static int
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/smooth.c new/chrony-2.4.1/smooth.c
--- old/chrony-2.4/smooth.c     2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/smooth.c   2016-11-21 12:03:45.000000000 +0100
@@ -137,7 +137,7 @@
 static void
 update_stages(void)
 {
-  double s1, s2, s, l1, l2, l3, lc, f, f2;
+  double s1, s2, s, l1, l2, l3, lc, f, f2, l1t[2], l3t[2], err[2];
   int i, dir;
 
   /* Prepare the three stages so that the integral of the frequency offset
@@ -146,22 +146,41 @@
   s1 = smooth_offset / max_wander;
   s2 = smooth_freq * smooth_freq / (2.0 * max_wander * max_wander);
   
-  l1 = l2 = l3 = 0.0;
-
   /* Calculate the lengths of the 1st and 3rd stage assuming there is no
-     frequency limit.  If length of the 1st stage comes out negative, switch
-     its direction. */
-  for (dir = -1; dir <= 1; dir += 2) {
+     frequency limit.  The direction of the 1st stage is selected so that
+     the lengths will not be negative.  With extremely small offsets both
+     directions may give a negative length due to numerical errors, so select
+     the one which gives a smaller error. */
+
+  for (i = 0, dir = -1; i <= 1; i++, dir += 2) {
+    err[i] = 0.0;
     s = dir * s1 + s2;
-    if (s >= 0.0) {
-      l3 = sqrt(s);
-      l1 = l3 - dir * smooth_freq / max_wander;
-      if (l1 >= 0.0)
-        break;
+
+    if (s < 0.0) {
+      err[i] += -s;
+      s = 0.0;
+    }
+
+    l3t[i] = sqrt(s);
+    l1t[i] = l3t[i] - dir * smooth_freq / max_wander;
+
+    if (l1t[i] < 0.0) {
+      err[i] += l1t[i] * l1t[i];
+      l1t[i] = 0.0;
     }
   }
 
-  assert(dir <= 1 && l1 >= 0.0 && l3 >= 0.0);
+  if (err[0] < err[1]) {
+    l1 = l1t[0];
+    l3 = l3t[0];
+    dir = -1;
+  } else {
+    l1 = l1t[1];
+    l3 = l3t[1];
+    dir = 1;
+  }
+
+  l2 = 0.0;
 
   /* If the limit was reached, shorten 1st+3rd stages and set a 2nd stage */
   f = dir * smooth_freq + l1 * max_wander - max_freq;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/sources.c new/chrony-2.4.1/sources.c
--- old/chrony-2.4/sources.c    2016-06-07 11:20:59.000000000 +0200
+++ new/chrony-2.4.1/sources.c  2016-11-21 12:03:45.000000000 +0100
@@ -74,6 +74,7 @@
   SRC_WAITS_STATS,      /* Others have bad stats, selection postponed */
   SRC_STALE,            /* Has older samples than others */
   SRC_ORPHAN,           /* Has stratum equal or larger than orphan stratum */
+  SRC_UNTRUSTED,        /* Overlaps trusted sources */
   SRC_FALSETICKER,      /* Doesn't agree with others */
   SRC_JITTERY,          /* Scatter worse than other's dispersion (not used) */
   SRC_WAITS_SOURCES,    /* Not enough sources, selection postponed */
@@ -890,6 +891,9 @@
 
       if (sources[i]->sel_options & SRC_SELECT_REQUIRE)
         sel_req_source = 0;
+    } else if (sources[i]->sel_info.lo_limit <= best_lo &&
+               sources[i]->sel_info.hi_limit >= best_hi) {
+      sources[i]->status = SRC_UNTRUSTED;
     } else {
       sources[i]->status = SRC_FALSETICKER;
     }
@@ -1318,6 +1322,7 @@
       case SRC_JITTERY:
         report->state = RPT_JITTERY;
         break;
+      case SRC_UNTRUSTED:
       case SRC_WAITS_SOURCES:
       case SRC_NONPREFERRED:
       case SRC_WAITS_UPDATE:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/test/unit/smooth.c 
new/chrony-2.4.1/test/unit/smooth.c
--- old/chrony-2.4/test/unit/smooth.c   1970-01-01 01:00:00.000000000 +0100
+++ new/chrony-2.4.1/test/unit/smooth.c 2016-11-21 12:03:45.000000000 +0100
@@ -0,0 +1,63 @@
+/*
+ **********************************************************************
+ * Copyright (C) Miroslav Lichvar  2016
+ * 
+ * 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
+ * published by the Free Software Foundation.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * 
+ **********************************************************************
+ */
+
+#include <smooth.c>
+#include "test.h"
+
+void
+test_unit(void)
+{
+  int i, j;
+  struct timeval tv;
+  double offset, freq, wander;
+  char conf[] = "smoothtime 300 0.01";
+
+  CNF_Initialise(0);
+  CNF_ParseLine(NULL, 1, conf);
+
+  LCL_Initialise();
+  SMT_Initialise();
+  locked = 0;
+
+  for (i = 0; i < 500; i++) {
+    tv.tv_sec = tv.tv_usec = 0;
+    SMT_Reset(&tv);
+
+    DEBUG_LOG(0, "iteration %d", i);
+
+    offset = (random() % 1000000 - 500000) / 1.0e6;
+    freq = (random() % 1000000 - 500000) / 1.0e9;
+    update_smoothing(&tv, offset, freq);
+
+    for (j = 0; j < 10000; j++) {
+      update_smoothing(&tv, 0.0, 0.0);
+      UTI_AddDoubleToTimeval(&tv, 16.0, &tv);
+      get_smoothing(&tv, &offset, &freq, &wander);
+    }
+
+    TEST_CHECK(fabs(offset) < 1e-12);
+    TEST_CHECK(fabs(freq) < 1e-12);
+    TEST_CHECK(fabs(wander) < 1e-12);
+  }
+
+  SMT_Finalise();
+  LCL_Finalise();
+  CNF_Finalise();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/chrony-2.4/version.txt new/chrony-2.4.1/version.txt
--- old/chrony-2.4/version.txt  2016-06-07 11:27:24.000000000 +0200
+++ new/chrony-2.4.1/version.txt        2016-11-21 12:10:55.000000000 +0100
@@ -1 +1 @@
-2.4
+2.4.1


Reply via email to