From c315de63546fd10525dc015068b7700076f8cd92 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 26 Feb 2016 21:14:28 -0800 Subject: [PATCH] JSON: check the source id, not the server id. --- adsbus/json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adsbus/json.c b/adsbus/json.c index 31c30f3..e5280c6 100644 --- a/adsbus/json.c +++ b/adsbus/json.c @@ -99,10 +99,6 @@ static bool json_parse_header(json_t *in, struct packet *packet, struct json_par state->mlat_timestamp_max = (uint64_t) mlat_timestamp_max; state->rssi_max = (uint32_t) rssi_max; - if (!packet_validate_id((const uint8_t *) json_server_id)) { - return false; - } - if (!strcmp(json_server_id, (const char *) server_id)) { fprintf(stderr, "R %s: Attempt to receive json data from our own server ID (%s); loop!\n", packet->source_id, server_id); return false; @@ -124,6 +120,10 @@ static bool json_parse_common(json_t *in, struct packet *packet, struct json_par return false; } + if (!packet_validate_id(packet->source_id)) { + return false; + } + json_t *mlat_timestamp = json_object_get(in, "mlat_timestamp"); if (mlat_timestamp && json_is_integer(mlat_timestamp)) { json_int_t val = json_integer_value(mlat_timestamp);