aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/l2cap_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 8136752d824b..e699837c3b8c 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -907,6 +907,9 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
907 if (!conn->hcon->out && conn->hcon->type == LE_LINK) 907 if (!conn->hcon->out && conn->hcon->type == LE_LINK)
908 l2cap_le_conn_ready(conn); 908 l2cap_le_conn_ready(conn);
909 909
910 if (conn->hcon->out && conn->hcon->type == LE_LINK)
911 smp_conn_security(conn, conn->hcon->pending_sec_level);
912
910 read_lock(&conn->chan_lock); 913 read_lock(&conn->chan_lock);
911 914
912 list_for_each_entry(chan, &conn->chan_l, list) { 915 list_for_each_entry(chan, &conn->chan_l, list) {
@@ -4095,6 +4098,11 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
4095 4098
4096 BT_DBG("conn %p", conn); 4099 BT_DBG("conn %p", conn);
4097 4100
4101 if (hcon->type == LE_LINK) {
4102 smp_distribute_keys(conn, 0);
4103 del_timer(&conn->security_timer);
4104 }
4105
4098 read_lock(&conn->chan_lock); 4106 read_lock(&conn->chan_lock);
4099 4107
4100 list_for_each_entry(chan, &conn->chan_l, list) { 4108 list_for_each_entry(chan, &conn->chan_l, list) {
@@ -4107,9 +4115,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
4107 if (chan->scid == L2CAP_CID_LE_DATA) { 4115 if (chan->scid == L2CAP_CID_LE_DATA) {
4108 if (!status && encrypt) { 4116 if (!status && encrypt) {
4109 chan->sec_level = hcon->sec_level; 4117 chan->sec_level = hcon->sec_level;
4110 del_timer(&conn->security_timer);
4111 l2cap_chan_ready(sk); 4118 l2cap_chan_ready(sk);
4112 smp_distribute_keys(conn, 0);
4113 } 4119 }
4114 4120
4115 bh_unlock_sock(sk); 4121 bh_unlock_sock(sk);