diff --git a/src/src/radio.c b/src/src/radio.c index f5be2a9f..d54d1e6f 100644 --- a/src/src/radio.c +++ b/src/src/radio.c @@ -678,10 +678,16 @@ static bool isFilterMaskValid(uint8_t mask) if ( // Case 1 ((mask & RADIO_BCAST_PANID_FILTER_MASK) || (mask & RADIO_BCAST_ADDR_FILTER_MASK)) || - // Case 2 - ((mask & 0x0F) == (mask >> 4)) || + // Case 2 - Find any non-broadcast PAN ID match and get ready to compare it + ((((mask & (RADIO_INDEX0_PANID_FILTER_MASK | RADIO_INDEX1_PANID_FILTER_MASK | RADIO_INDEX2_PANID_FILTER_MASK)) + >> RADIO_PANID_FILTER_SHIFT) + & + // To see if it coincides with any address matches for same IID + (RADIO_GET_ADDR_FILTER_MASK(mask) >> RADIO_ADDR_FILTER_SHIFT)) + != 0) + || // Case 3 - (((mask & 0x0F) == 0) || ((mask >> 4) == 0))) + (((RADIO_GET_PANID_FILTER_MASK(mask)) == 0) || ((RADIO_GET_ADDR_FILTER_MASK(mask)) == 0))) { valid = true; }