nimble/ll: Fix peer address check with privacy

We should explicitly chceck if AdvA is identity instead of just
comparing address types. Comparing address types can give incorrect
result if peer identity address is static random since both static
random and RPA are random addresses.
This commit is contained in:
Andrzej Kaczmarek
2019-06-17 16:04:58 +02:00
parent f1e9720bc3
commit e46fdc90e0
+1 -1
View File
@@ -2524,7 +2524,7 @@ ble_ll_conn_is_peer_adv(uint8_t addr_type, uint8_t *adva, int index)
/* Fall-through intentional */
case BLE_HCI_CONN_PEER_ADDR_PUBLIC:
case BLE_HCI_CONN_PEER_ADDR_RANDOM:
if (addr_type == connsm->peer_addr_type) {
if (ble_ll_addr_is_id(adva, addr_type)) {
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
/* Peer uses its identity address. Let's verify privacy mode.
*