浏览代码

Bluetooth: Allow l2cap_chan_check_security() to be used for LE links.

With connection oriented L2CAP channels some code paths will be shared
with BR/EDR links. It is therefore necessary to allow the
l2cap_chan_check_security function to be usable also for LE links in
addition to BR/EDR ones. This means that smp_conn_security() needs to be
called instead of hci_conn_security() in the case of an LE link.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 12 年之前
父节点
当前提交
a17de2fe02
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/bluetooth/l2cap_core.c

+ 3 - 0
net/bluetooth/l2cap_core.c

@@ -726,6 +726,9 @@ int l2cap_chan_check_security(struct l2cap_chan *chan)
 	struct l2cap_conn *conn = chan->conn;
 	struct l2cap_conn *conn = chan->conn;
 	__u8 auth_type;
 	__u8 auth_type;
 
 
+	if (conn->hcon->type == LE_LINK)
+		return smp_conn_security(conn->hcon, chan->sec_level);
+
 	auth_type = l2cap_get_auth_type(chan);
 	auth_type = l2cap_get_auth_type(chan);
 
 
 	return hci_conn_security(conn->hcon, chan->sec_level, auth_type);
 	return hci_conn_security(conn->hcon, chan->sec_level, auth_type);