diff options
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index d958e2dca52f..521fd4f3985e 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -819,14 +819,17 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
819 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { | 819 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { |
820 | struct hci_cp_auth_requested cp; | 820 | struct hci_cp_auth_requested cp; |
821 | 821 | ||
822 | /* encrypt must be pending if auth is also pending */ | ||
823 | set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | ||
824 | |||
825 | cp.handle = cpu_to_le16(conn->handle); | 822 | cp.handle = cpu_to_le16(conn->handle); |
826 | hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED, | 823 | hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED, |
827 | sizeof(cp), &cp); | 824 | sizeof(cp), &cp); |
825 | |||
826 | /* If we're already encrypted set the REAUTH_PEND flag, | ||
827 | * otherwise set the ENCRYPT_PEND. | ||
828 | */ | ||
828 | if (conn->key_type != 0xff) | 829 | if (conn->key_type != 0xff) |
829 | set_bit(HCI_CONN_REAUTH_PEND, &conn->flags); | 830 | set_bit(HCI_CONN_REAUTH_PEND, &conn->flags); |
831 | else | ||
832 | set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | ||
830 | } | 833 | } |
831 | 834 | ||
832 | return 0; | 835 | return 0; |