NimBLE : Change peer_addr type to PUBLIC in case of Host based privacy

- When Identity of peer is resolved and peer address is RPA then NimBLE stack
  changes the peer_addr type to PUBLIC_ID(0x02); in Host based privacy it
  should not be done as it can result in mismatch while comparing stored
  addresses especially in case of CCCD storage.
This commit is contained in:
Prasad Alatkar
2020-05-08 16:14:07 +05:30
parent 4e38864864
commit 26a46a9b31
+5
View File
@@ -538,6 +538,11 @@ ble_sm_persist_keys(struct ble_sm_proc *proc)
case BLE_ADDR_PUBLIC:
case BLE_ADDR_PUBLIC_ID:
conn->bhc_peer_addr.type = BLE_ADDR_PUBLIC_ID;
#if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
/* In case of Host based privacy, we should not be changing
* peer address type to BLE_ADDR_PUBLIC_ID */
conn->bhc_peer_addr.type = BLE_ADDR_PUBLIC;
#endif
break;
case BLE_ADDR_RANDOM: