From debbf336f4e1aedcbc4fecc8fa674f08231a048d Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Fri, 26 Jun 2026 20:15:28 +0800 Subject: [PATCH] fix(ble/bluedroid): skip identity conversion for static random direct connect Do not rewrite static or non-resolvable random peer addresses to identity type 0x03 when CONFIG_BT_BLE_RPA_SUPPORTED is enabled. (cherry picked from commit 2ef10ef488d7a11f665ecac3a77fedfe875784db) Co-authored-by: zhanghaipeng --- components/bt/host/bluedroid/stack/l2cap/l2c_ble.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c index d4acd714ae8..39ce43265d7 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c @@ -993,12 +993,14 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb) #if (CONTROLLER_RPA_LIST_ENABLE) if (p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) { - if (btm_cb.ble_ctr_cb.privacy_mode >= BTM_PRIVACY_1_2) { - own_addr_type |= BLE_ADDR_TYPE_ID_BIT; - } + if (!(peer_addr_type == BLE_ADDR_RANDOM && !BTM_BLE_IS_RESOLVE_BDA(peer_addr))) { + if (btm_cb.ble_ctr_cb.privacy_mode >= BTM_PRIVACY_1_2) { + own_addr_type |= BLE_ADDR_TYPE_ID_BIT; + } - //btm_ble_enable_resolving_list(BTM_BLE_RL_INIT); - btm_random_pseudo_to_identity_addr(peer_addr, &peer_addr_type); + //btm_ble_enable_resolving_list(BTM_BLE_RL_INIT); + btm_random_pseudo_to_identity_addr(peer_addr, &peer_addr_type); + } } else { btm_ble_disable_resolving_list(BTM_BLE_RL_INIT, TRUE); }