aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-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)
397{ 397{
398 BT_DBG("conn %p", conn); 398 BT_DBG("conn %p", conn);
399 399
400 if (sec_level > conn->sec_level) { 400 if (sec_level > conn->sec_level)
401 conn->sec_level = sec_level; 401 conn->sec_level = sec_level;
402 conn->auth_type = auth_type; 402 else if (conn->link_mode & HCI_LM_AUTH)
403 } else if (conn->link_mode & HCI_LM_AUTH)
404 return 1; 403 return 1;
405 404
405 conn->auth_type = auth_type;
406
406 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) { 407 if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
407 struct hci_cp_auth_requested cp; 408 struct hci_cp_auth_requested cp;
408 cp.handle = cpu_to_le16(conn->handle); 409 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)
418{ 419{
419 BT_DBG("conn %p", conn); 420 BT_DBG("conn %p", conn);
420 421
421 if (conn->auth_type == 0xff)
422 conn->auth_type = auth_type;
423
424 if (sec_level == BT_SECURITY_SDP) 422 if (sec_level == BT_SECURITY_SDP)
425 return 1; 423 return 1;
426 424