summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-04-06 13:59:17 -0700
committerGary E. Miller <gem@rellim.com>2016-04-06 13:59:17 -0700
commitdfebe3fac76ebb27c39d6cb0a623b3b24ed95572 (patch)
tree74bc3f460f2fd0307f39d5092ec46d8a1e3c3d0f /gpsd.c
parentc2cdd535f7c6791c378b9c889842a0b38bacb133 (diff)
downloadgpsd-dfebe3fac76ebb27c39d6cb0a623b3b24ed95572.tar.gz
RTCM3 packets can be bigger than RTCM2 ones.
I have seen up to about 490 in RTCM3.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index 2381e17c..6f575cd5 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1474,10 +1474,16 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
* If the device provided an RTCM packet, repeat it to all devices.
*/
if ((changed & RTCM2_SET) != 0 || (changed & RTCM3_SET) != 0) {
- if (device->lexer.outbuflen > RTCM_MAX) {
+ if ((changed & RTCM2_SET) != 0
+ && device->lexer.outbuflen > RTCM_MAX) {
gpsd_log(&context.errout, LOG_ERROR,
"overlong RTCM packet (%zd bytes)\n",
device->lexer.outbuflen);
+ } else if ((changed & RTCM3_SET) != 0
+ && device->lexer.outbuflen > RTCM3_MAX) {
+ gpsd_log(&context.errout, LOG_ERROR,
+ "overlong RTCM3 packet (%zd bytes)\n",
+ device->lexer.outbuflen);
} else {
struct gps_device_t *dp;
for (dp = devices; dp < devices+MAX_DEVICES; dp++) {