diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-04-11 12:02:31 -0700 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-06-06 12:38:23 +0200 |
commit | 933d4bfa946ca681b33ff29b4994887c5787968a (patch) | |
tree | b49e3fe313340ce4155f6f96560441d542eb3ded | |
parent | fde051cada91a1ae03eec8b8dd13b09379cf9dbf (diff) |
Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
commit 9eb1fbfa0a737fd4d3a6d12d71c5ea9af622b887 upstream.
Commit 1c2e004183178 introduced an event handler for the encryption key
refresh complete event with the intent of fixing some LE/SMP cases.
However, this event is shared with BR/EDR and there we actually want to
act only on the auth_complete event (which comes after the key refresh).
If we do not do this we may trigger an L2CAP Connect Request too early
and cause the remote side to return a security block error.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | net/bluetooth/hci_event.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index a3af2b750e9..2eeb6643d78 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2993,6 +2993,12 @@ static void hci_key_refresh_complete_evt(struct hci_dev *hdev, if (!conn) goto unlock; + /* For BR/EDR the necessary steps are taken through the + * auth_complete event. + */ + if (conn->type != LE_LINK) + goto unlock; + if (!ev->status) conn->sec_level = conn->pending_sec_level; |