[hamradio-commits] [dump1090] 191/373: VK1ET : Check Bit Correction against ICAO cache

Matthew Ernisse mernisse-guest at moszumanska.debian.org
Thu Oct 23 14:58:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

mernisse-guest pushed a commit to branch backport
in repository dump1090.

commit e33591d65d03fd29b14685b255e4366acc765626
Author: Malcolm Robb <Support at ATTAvionics.com>
Date:   Tue May 21 16:01:54 2013 +0100

    VK1ET : Check Bit Correction against ICAO cache
    
    If we error correct a DF17 frame, check that the ICAOaddr exists in our
    recently seen ICAO cache. This reduces the likelyhood of birthday
    paradox solutions producing false ICAO addresses
---
 dump1090.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/dump1090.c b/dump1090.c
index 887b15b..f7fb858 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -1707,7 +1707,7 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
     mm->msgtype         = msg[0] >> 3; // Downlink Format
     mm->msgbits         = modesMessageLenByType(mm->msgtype);
     mm->correctedbits   = 0; // No errors fixed
-    mm->phase_corrected =  0;
+    mm->phase_corrected = 0;
     mm->crc             = modesChecksum(msg, mm->msgbits);
 
     if ((mm->crc) && (Modes.fix_errors) &&  (mm->msgtype == 17)) {
@@ -1723,9 +1723,12 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) {
         // IID against known good IID's. That's a TODO.
         //
         mm->correctedbits = fixBitErrors(msg, mm->msgbits);
-        //if ((mm->errorbit == -1) && (Modes.aggressive)) {
-        //    mm->errorbit = fixTwoBitsErrors(msg, mm->msgbits);
-        //}
+        // If we correct, validate ICAO addr to help filter birthday paradox solutions.
+        if (mm->correctedbits) {
+            uint32_t addr = (msg[1] << 16) | (msg[2] << 8) | (msg[3]); 
+            if (!ICAOAddressWasRecentlySeen(addr))
+                mm->correctedbits = 0;
+        }
     }
     //
     // Note that most of the other computation happens *after* we fix the 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git



More information about the pkg-hamradio-commits mailing list