summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg2014-02-18 16:14:34 +0100
committerMarcel Holtmann2014-02-18 17:58:20 +0100
commitb7d448d74a09af412d778918415fe2ea4d5c2de4 (patch)
tree197e61f024c1cf644107b6f1a830a4fd5381b273
parentBluetooth: Fix hci_remove_ltk failure when no match is found (diff)
downloadkernel-qcow2-linux-b7d448d74a09af412d778918415fe2ea4d5c2de4.tar.gz
kernel-qcow2-linux-b7d448d74a09af412d778918415fe2ea4d5c2de4.tar.xz
kernel-qcow2-linux-b7d448d74a09af412d778918415fe2ea4d5c2de4.zip
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>
-rw-r--r--net/bluetooth/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 5867c1c3f436..0c0dd1b52b66 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1175,7 +1175,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force)
*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);
cancel_delayed_work_sync(&conn->security_timer);
smp_chan_destroy(conn);