Skip to content

Commit

Permalink
Bluetooth: Fix triggering BR/EDR L2CAP Connect too early
Browse files Browse the repository at this point in the history
Commit 1c2e004 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>
Cc: stable@vger.kernel.org
  • Loading branch information
Johan Hedberg committed Apr 25, 2014
1 parent 3c49aa8 commit 9eb1fbf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,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;

Expand Down

0 comments on commit 9eb1fbf

Please sign in to comment.