Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d5d898c authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix btm_ble_get_acl_remote_addr

Second parameter, conn_addr, should be assigned the value. Right now we
only modify the place in memory where the pointer points to.
This bug was introduced in commit
014593a0

Test: compilation test
Change-Id: If52a6b02f4ad0d88a6461a4d76e4f8317dcaac9f
parent 2045302b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ uint8_t btm_handle_to_acl_index(uint16_t hci_handle) {
 *
 ******************************************************************************/
bool btm_ble_get_acl_remote_addr(tBTM_SEC_DEV_REC* p_dev_rec,
                                 bt_bdaddr_t* conn_addr,
                                 bt_bdaddr_t& conn_addr,
                                 tBLE_ADDR_TYPE* p_addr_type) {
  bool st = true;

@@ -151,17 +151,17 @@ bool btm_ble_get_acl_remote_addr(tBTM_SEC_DEV_REC* p_dev_rec,

  switch (p_dev_rec->ble.active_addr_type) {
    case BTM_BLE_ADDR_PSEUDO:
      conn_addr = &p_dev_rec->bd_addr;
      conn_addr = p_dev_rec->bd_addr;
      *p_addr_type = p_dev_rec->ble.ble_addr_type;
      break;

    case BTM_BLE_ADDR_RRA:
      conn_addr = &p_dev_rec->ble.cur_rand_addr;
      conn_addr = p_dev_rec->ble.cur_rand_addr;
      *p_addr_type = BLE_ADDR_RANDOM;
      break;

    case BTM_BLE_ADDR_STATIC:
      conn_addr = &p_dev_rec->ble.static_addr;
      conn_addr = p_dev_rec->ble.static_addr;
      *p_addr_type = p_dev_rec->ble.static_addr_type;
      break;

@@ -270,7 +270,7 @@ void btm_acl_created(const bt_bdaddr_t& bda, DEV_CLASS dc, BD_NAME bdn,
      /* If here, features are not known yet */
      if (p_dev_rec && transport == BT_TRANSPORT_LE) {
#if (BLE_PRIVACY_SPT == TRUE)
        btm_ble_get_acl_remote_addr(p_dev_rec, &p->active_remote_addr,
        btm_ble_get_acl_remote_addr(p_dev_rec, p->active_remote_addr,
                                    &p->active_remote_addr_type);
#endif