summaryrefslogtreecommitdiff
path: root/driver_sirf.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-01-16 12:04:35 -0500
committerEric S. Raymond <esr@thyrsus.com>2016-01-16 12:04:35 -0500
commit4da3d327a8e283228ebd96e1131bb646813ba71a (patch)
treea22c20e5160d0423fef73c5218a13757c18e2513 /driver_sirf.c
parent63e3a8a3123a1625ae857025ada400e1bf686345 (diff)
downloadgpsd-4da3d327a8e283228ebd96e1131bb646813ba71a.tar.gz
Prevent a subtle bug in the SiRF driver that sometimes caused NTP problems.
Simon Hradecky <shradecky@nomissoft.com> writes: I just verified a bug in the driver_sirf.c (version 3.15, I just discovered 3.16 was released a few days ago, didn't yet check this version), routine sirf_time_offset: Line 637: double retval = NAN; This sets the default offset to NAN, which later results in the real time in ntp shared memory etc. to be set to 0 with a valid time stamp, further causing the NTP daemon to suddenly jump to year 1970, if the SIRF last status is not known to the driver. I believe, this default offset would be correct to read: double retval = 0; The problem with the real time set to 0 as result of the NAN time offset in the SIRF driver (while the clock time was correct) in ntp shared memory segment occurs frequently (but not always) with GlobalSat SIRF modules, in our case EB5531RE. This can happen at any time of operation, it is possible that the gpsd starts out entirely correct with proper time stamps in all fields and suddenly forces the NTP to 0 seconds since 1970 because the offset becomes NAN.
Diffstat (limited to 'driver_sirf.c')
-rw-r--r--driver_sirf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver_sirf.c b/driver_sirf.c
index 945f6c14..6259bb9f 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -633,7 +633,7 @@ static gps_mask_t sirf_msg_svinfo(struct gps_device_t *session,
static double sirf_time_offset(struct gps_device_t *session)
/* return NTP time-offset fudge factor for this device */
{
- double retval = NAN;
+ double retval = 0;
/* we need to have seen UTC time with a valid leap-year offset */
if ((session->driver.sirf.time_seen & TIME_SEEN_UTC_2) != 0) {