summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-17 09:16:32 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-17 09:16:32 -0400
commit950249ef7f9773fd95efb96cf2723832a760a242 (patch)
tree444cbc05b9f3c1fa58413a612072eaf09c42ff5b /libgpsd_core.c
parentfceb4965d0bbb47b0ffdf0ef78c56fc531c7b650 (diff)
downloadgpsd-950249ef7f9773fd95efb96cf2723832a760a242.tar.gz
Be certain the new logic filters out packets with bad checksums.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 956becbf..83c4ee29 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1477,15 +1477,21 @@ int gpsd_multipoll(const bool data_ready,
/* conditional prevents mask dumper from eating CPU */
if (device->context->debug >= LOG_DATA)
- gpsd_report(device->context->debug, LOG_DATA,
- "packet type %d from %s with %s\n",
- device->packet.type,
- device->gpsdata.dev.path,
- gps_maskdump(device->gpsdata.set));
+ if (device->packet.type == BAD_PACKET)
+ gpsd_report(device->context->debug, LOG_DATA,
+ "packet with bad checksum from %s\n",
+ device->gpsdata.dev.path);
+ else
+ gpsd_report(device->context->debug, LOG_DATA,
+ "packet type %d from %s with %s\n",
+ device->packet.type,
+ device->gpsdata.dev.path,
+ gps_maskdump(device->gpsdata.set));
/* handle data contained in this packet */
- /*@i1@*/handler(device, changed);
+ if (device->packet.type != BAD_PACKET)
+ /*@i1@*/handler(device, changed);
}
}
else if (device->reawake>0 && timestamp()>device->reawake) {