diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2011-06-09 17:50:51 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-06-13 15:05:35 -0400 |
commit | 88167aed0d2e84364c8f0d9e48429c21fc7894c3 (patch) | |
tree | edca14a99df8944e629856de8a2c01d0ddebf678 /include/net/bluetooth/hci_core.h | |
parent | 7b5c0d5242295a3b52e7161bf129e2f0e8c624cb (diff) |
Bluetooth: Update the security level when link is encrypted
If the pending security level is greater than the current security
level and the link is now encrypted, we should update the link
security level.
This is only useful for LE links, when the only event generated
when SMP is sucessful in the Encrypt Change event.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ab6842c6e49a..fe05946c8f0b 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -745,6 +745,9 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
745 | if (conn->sec_level == BT_SECURITY_SDP) | 745 | if (conn->sec_level == BT_SECURITY_SDP) |
746 | conn->sec_level = BT_SECURITY_LOW; | 746 | conn->sec_level = BT_SECURITY_LOW; |
747 | 747 | ||
748 | if (conn->pending_sec_level > conn->sec_level) | ||
749 | conn->sec_level = conn->pending_sec_level; | ||
750 | |||
748 | hci_proto_encrypt_cfm(conn, status, encrypt); | 751 | hci_proto_encrypt_cfm(conn, status, encrypt); |
749 | 752 | ||
750 | read_lock_bh(&hci_cb_list_lock); | 753 | read_lock_bh(&hci_cb_list_lock); |