diff options
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index fe712a89a856..99cd8d9d891b 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -379,7 +379,8 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 | |||
379 | hci_conn_hold(acl); | 379 | hci_conn_hold(acl); |
380 | 380 | ||
381 | if (acl->state == BT_OPEN || acl->state == BT_CLOSED) { | 381 | if (acl->state == BT_OPEN || acl->state == BT_CLOSED) { |
382 | acl->sec_level = sec_level; | 382 | acl->sec_level = BT_SECURITY_LOW; |
383 | acl->pending_sec_level = sec_level; | ||
383 | acl->auth_type = auth_type; | 384 | acl->auth_type = auth_type; |
384 | hci_acl_connect(acl); | 385 | hci_acl_connect(acl); |
385 | } | 386 | } |
@@ -437,8 +438,11 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
437 | { | 438 | { |
438 | BT_DBG("conn %p", conn); | 439 | BT_DBG("conn %p", conn); |
439 | 440 | ||
441 | if (conn->pending_sec_level > sec_level) | ||
442 | sec_level = conn->pending_sec_level; | ||
443 | |||
440 | if (sec_level > conn->sec_level) | 444 | if (sec_level > conn->sec_level) |
441 | conn->sec_level = sec_level; | 445 | conn->pending_sec_level = sec_level; |
442 | else if (conn->link_mode & HCI_LM_AUTH) | 446 | else if (conn->link_mode & HCI_LM_AUTH) |
443 | return 1; | 447 | return 1; |
444 | 448 | ||