Bluetooth: SMP: Don't start pairing if it is already in progress
Change-Id: Ie720e4facb00de3c2fe8b8635a84b4b96a1bee53 Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
parent
e8bcb6afc0
commit
1ffed52c45
1 changed files with 10 additions and 0 deletions
|
@ -597,6 +597,11 @@ int bt_smp_send_security_req(struct bt_conn *conn)
|
|||
|
||||
BT_DBG("\n");
|
||||
|
||||
/* pairing is in progress */
|
||||
if (atomic_test_bit(&smp->flags, SMP_FLAG_PAIRING)) {
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* early verify if required sec level if reachable */
|
||||
if (!sec_level_reachable(conn)) {
|
||||
return -EINVAL;
|
||||
|
@ -633,6 +638,11 @@ int bt_smp_send_pairing_req(struct bt_conn *conn)
|
|||
|
||||
BT_DBG("\n");
|
||||
|
||||
/* pairing is in progress */
|
||||
if (atomic_test_bit(&smp->flags, SMP_FLAG_PAIRING)) {
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* early verify if required sec level if reachable */
|
||||
if (!sec_level_reachable(conn)) {
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue