Return-Path: From: Vinicius Costa Gomes To: linux-bluetooth@vger.kernel.org Cc: Vinicius Costa Gomes Subject: [PATCH 8/8] Bluetooth: Only increase the connection sec-level if encryption is successful Date: Thu, 10 Nov 2011 22:03:56 -0300 Message-Id: <1320973436-13399-9-git-send-email-vinicius.gomes@openbossa.org> In-Reply-To: <1320973436-13399-1-git-send-email-vinicius.gomes@openbossa.org> References: <1320973436-13399-1-git-send-email-vinicius.gomes@openbossa.org> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Signed-off-by: Vinicius Costa Gomes --- include/net/bluetooth/hci_core.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index b5cc198..25287de 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -845,7 +845,7 @@ 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) + if (!status && conn->pending_sec_level > conn->sec_level) conn->sec_level = conn->pending_sec_level; hci_proto_encrypt_cfm(conn, status, encrypt); -- 1.7.7