From 85aa200947fca0e4b8c4bb6ad02ce208cfcdbe6b Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 3 Mar 2016 12:39:01 +0000 Subject: [PATCH] Extra paranoia for --aggressive mode: only forward 2-bit-corrected messages via paths that allow the recipient to see that they are 2-bit-corrected i.e. raw or beast output in --net-verbatim mode only. --- net_io.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net_io.c b/net_io.c index 1fa32f1..9b3facc 100644 --- a/net_io.c +++ b/net_io.c @@ -676,12 +676,21 @@ static void send_sbs_heartbeat(struct net_service *service) void modesQueueOutput(struct modesMessage *mm, struct aircraft *a) { int is_mlat = ((mm->bFlags & MODES_ACFLAGS_FROM_MLAT) != 0); - if (!is_mlat) { + if (!is_mlat && mm->correctedbits < 2) { + // Don't ever forward 2-bit-corrected messages via SBS output. + // Don't ever forward mlat messages via SBS output. modesSendSBSOutput(mm, a); + } + + if (!is_mlat && (Modes.net_verbatim || mm->correctedbits < 2)) { + // Forward 2-bit-corrected messages via raw output only if --net-verbatim is set + // Don't ever forward mlat messages via raw output. modesSendRawOutput(mm); } - if (!is_mlat || Modes.forward_mlat) { + if ((!is_mlat || Modes.forward_mlat) && (Modes.net_verbatim || mm->correctedbits < 2)) { + // Forward 2-bit-corrected messages via beast output only if --net-verbatim is set + // Forward mlat messages via beast output only if --forward-mlat is set modesSendBeastOutput(mm); } }