From 75851778c0a0b42bae713fb99426d427a291f4ab Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Mon, 29 Jun 2015 00:32:30 +0100 Subject: [PATCH] Fix up filter population so it's not completely insane. The logic for DF11 was completely broken and inverted. How did this ever work?? Actually, the broken version kinda works because the only types of message that can yield an address that's not already in the ICAO filter are DF11/17/18. So DF=17; DF=18; and DF=11 with IID=0 would pass the broken logic and populate the filter. All other DFs would pass the broken test, too, but they can only ever re-add entries that were already there. --- mode_s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mode_s.c b/mode_s.c index 0a070d5..3c50d87 100644 --- a/mode_s.c +++ b/mode_s.c @@ -656,7 +656,7 @@ int decodeModesMessage(struct modesMessage *mm, unsigned char *msg) mm->bFlags |= MODES_ACFLAGS_AOG; } - if (!mm->correctedbits && (mm->msgtype == 17 || mm->msgtype == 18 || (mm->msgtype != 11 || mm->iid == 0))) { + if (!mm->correctedbits && (mm->msgtype == 17 || mm->msgtype == 18 || (mm->msgtype == 11 && mm->iid == 0))) { // No CRC errors seen, and either it was an DF17/18 extended squitter // or a DF11 acquisition squitter with II = 0. We probably have the right address.