summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-05-13 21:27:44 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-05-13 21:27:44 +0200
commit3231d65ffe36e177caf5006d4079867d9b7b2d4a (patch)
tree375c625573387973b4d03ca80eaed2477490fc8b /net/bluetooth/hci_conn.c
parentMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlw... (diff)
parentMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlw... (diff)
downloadlinux-3231d65ffe36e177caf5006d4079867d9b7b2d4a.tar.xz
linux-3231d65ffe36e177caf5006d4079867d9b7b2d4a.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 55a174317925..095943c02d6e 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -884,14 +884,17 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
struct hci_cp_auth_requested cp;
- /* encrypt must be pending if auth is also pending */
- set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
-
cp.handle = cpu_to_le16(conn->handle);
hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
sizeof(cp), &cp);
+
+ /* If we're already encrypted set the REAUTH_PEND flag,
+ * otherwise set the ENCRYPT_PEND.
+ */
if (conn->key_type != 0xff)
set_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
+ else
+ set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
}
return 0;