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:
Szymon Janc 2015-09-24 17:31:02 +02:00 committed by Anas Nashif
commit 1ffed52c45

View file

@ -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;