summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-02-12 16:23:03 +0100
committerNick Pelly <npelly@google.com>2009-04-06 17:39:30 -0700
commitc79140f976f5f441053e984b8756358a9fc37e75 (patch)
tree5910b1661f7a778e3febfb1f666f7d59b21c9463 /net
parent0f660f4ad5973854096cee31f30d54c75187ec53 (diff)
Bluetooth: Set authentication requirement before requesting it
The authentication requirement got only updated when the security level increased. This is a wrong behavior. The authentication requirement is read by the Bluetooth daemon to make proper decisions when handling the IO capabilities exchange. So set the value that is currently expected by the higher layers like L2CAP and RFCOMM. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_conn.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 96281a11a186..efd5c926cc1b 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -397,12 +397,13 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
{
BT_DBG("conn %p", conn);
- if (sec_level > conn->sec_level) {
+ if (sec_level > conn->sec_level)
conn->sec_level = sec_level;
- conn->auth_type = auth_type;
- } else if (conn->link_mode & HCI_LM_AUTH)
+ else if (conn->link_mode & HCI_LM_AUTH)
return 1;
+ conn->auth_type = auth_type;
+
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
struct hci_cp_auth_requested cp;
cp.handle = cpu_to_le16(conn->handle);
@@ -418,9 +419,6 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
{
BT_DBG("conn %p", conn);
- if (conn->auth_type == 0xff)
- conn->auth_type = auth_type;
-
if (sec_level == BT_SECURITY_SDP)
return 1;