From: Vinicius Costa Gomes Date: Thu, 9 Jun 2011 21:50:51 +0000 (-0300) Subject: Bluetooth: Update the security level when link is encrypted X-Git-Tag: firefly_0821_release~7613^2~491 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=208dfd9cd7b736800d879bad5a1a23b6107ed85b;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Gustavo F. Padovan --- diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 50dabb6ebe61..9f98124208a7 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -747,6 +747,9 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, if (conn->sec_level == BT_SECURITY_SDP) conn->sec_level = BT_SECURITY_LOW; + if (conn->pending_sec_level > conn->sec_level) + conn->sec_level = conn->pending_sec_level; + hci_proto_encrypt_cfm(conn, status, encrypt); read_lock_bh(&hci_cb_list_lock);