mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-18 21:14:28 +00:00
Bluetooth: Fix completing SMP as peripheral when no keys are expected
When we're the acceptors (peripheral/slave) of an SMP procedure and we've completed distributing our keys we should only stick around waiting for keys from the remote side if any of the initiator distribution bits were actually set. This patch fixes the smp_distribute_keys function to clear the SMP context when this situation occurs. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
c51ffa0b2f
commit
b7d448d74a
1 changed files with 1 additions and 1 deletions
|
@ -1175,7 +1175,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
|
||||||
*keydist &= ~SMP_DIST_SIGN;
|
*keydist &= ~SMP_DIST_SIGN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->hcon->out || force) {
|
if (conn->hcon->out || force || !(rsp->init_key_dist & 0x07)) {
|
||||||
clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags);
|
clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags);
|
||||||
cancel_delayed_work_sync(&conn->security_timer);
|
cancel_delayed_work_sync(&conn->security_timer);
|
||||||
smp_chan_destroy(conn);
|
smp_chan_destroy(conn);
|
||||||
|
|
Loading…
Add table
Reference in a new issue