Code

chrony: fix conversion of clock_last_meas value
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Feb 2017 11:08:55 +0000 (12:08 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 23 Feb 2017 14:38:48 +0000 (15:38 +0100)
The f_since_sample field in source data has 32 bits.

src/chrony.c

index 11310b192773b2296f90389b2378d7d2ebd78ae2..0733e130ba649d581c4f0b07b0e741529453788e 100644 (file)
@@ -881,7 +881,7 @@ static int chrony_request_source_data(int p_src_idx, int *p_is_reachable) {
   chrony_push_data_valid("clock_reachability", src_addr, is_reachable,
                          ntohs(chrony_resp.body.source_data.f_reachability));
   chrony_push_data_valid("clock_last_meas", src_addr, is_reachable,
-                         ntohs(chrony_resp.body.source_data.f_since_sample));
+                         ntohl(chrony_resp.body.source_data.f_since_sample));
 
   return CHRONY_RC_OK;
 }