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.
This commit is contained in:
Oliver Jowett 2015-06-29 00:32:30 +01:00
parent 934dfee6a4
commit 75851778c0

View file

@ -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.