From 08168d36222d4cdace22bee76c5fe9ef8ca64902 Mon Sep 17 00:00:00 2001 From: Brian Gix Date: Mon, 23 Jan 2012 14:34:59 -0800 Subject: [PATCH] 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 --- net/bluetooth/l2cap_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 0f78d56bded..3e2146a85c0 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -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);