Bluetooth: LE sockets not ready until encrypted

If encryption fails during socket setup, the L2CAP channel should not
be marked as Ready until after re-pairing takes place.

Change-Id: I57a07ae72d4a57584c9367db9a832f4560629ac7
CRs-fixed: 335988
Signed-off-by: Brian Gix <bgix@codeaurora.org>
This commit is contained in:
Brian Gix
2012-01-23 14:34:59 -08:00
committed by Stephen Boyd
parent 5d354db0cd
commit 08168d3622

View File

@@ -7440,11 +7440,12 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
BT_DBG("sk->scid %d", l2cap_pi(sk)->scid);
if (l2cap_pi(sk)->scid == L2CAP_CID_LE_DATA) {
if (!status && encrypt)
if (!status && encrypt) {
l2cap_pi(sk)->sec_level = hcon->sec_level;
l2cap_chan_ready(sk);
}
del_timer(&hcon->smp_timer);
l2cap_chan_ready(sk);
smp_link_encrypt_cmplt(conn, status, encrypt);
bh_unlock_sock(sk);