aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-06-09 18:50:51 -0300
committerJaikumar Ganesh <jaikumar@google.com>2011-07-11 11:59:22 -0700
commit208dfd9cd7b736800d879bad5a1a23b6107ed85b (patch)
tree16460b0033a01c66cd5b5a276f30c44c885be169 /include/net/bluetooth
parent403d2c85b1bcbdac6bd90945f16b1ea975cbac38 (diff)
downloadkernel_samsung_espresso10-208dfd9cd7b736800d879bad5a1a23b6107ed85b.zip
kernel_samsung_espresso10-208dfd9cd7b736800d879bad5a1a23b6107ed85b.tar.gz
kernel_samsung_espresso10-208dfd9cd7b736800d879bad5a1a23b6107ed85b.tar.bz2
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')
-rw-r--r--include/net/bluetooth/hci_core.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 50dabb6..9f98124 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);