OSDN Git Service

Clear advertising cache if bad advertisement is received
authorHenrik Davidsen <h.davidsen@samsung.com>
Thu, 20 Aug 2020 11:23:01 +0000 (12:23 +0100)
committerJakub Pawlowski <jpawlowski@google.com>
Fri, 21 Aug 2020 18:13:56 +0000 (18:13 +0000)
Cache of advertisements from a device was not cleared if a bad
extended advertisement was received which caused that new
advertisements from same device address was rejected as invalid.

Tag: #stability
Test: receive malformed advertisement
Signed-off-by: Henrik Davidsen <h.davidsen@samsung.com>
Change-Id: If07010954fef235b696c8a120026934a7aeadcb5

stack/btm/btm_ble_gap.cc

index 8ad6717..905c912 100644 (file)
@@ -1858,6 +1858,7 @@ void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type,
   if (!AdvertiseDataParser::IsValid(adv_data)) {
     DVLOG(1) << __func__ << "Dropping bad advertisement packet: "
              << base::HexEncode(adv_data.data(), adv_data.size());
+    cache.Clear(addr_type, bda);
     return;
   }