bluetooth: host: smp: Add runtime check for central-specific path
Added run-time BT_CENTRAL role check for the path that was central specific and did not have such check. When multi-role BT device tried to pair without bonding (peripheral role) while already previously bonded with the same device on another Bluetooth identity, pairing failed. It executed central-specific code, which should not be executed in case when the device acts as peripheral (as it is even opt-out from code when CONFIG_BT_CENTRAL is not enabled). Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
This commit is contained in:
parent
c6cecef120
commit
7a1b194a97
1 changed files with 1 additions and 0 deletions
|
@ -4706,6 +4706,7 @@ static void bt_smp_encrypt_change(struct bt_l2cap_chan *chan,
|
|||
*/
|
||||
if (IS_ENABLED(CONFIG_BT_CENTRAL) &&
|
||||
IS_ENABLED(CONFIG_BT_PRIVACY) &&
|
||||
conn->role == BT_HCI_ROLE_CENTRAL &&
|
||||
!(smp->remote_dist & BT_SMP_DIST_ID_KEY)) {
|
||||
uint8_t smp_err;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue