Skip to content
Snippets Groups Projects
Commit d0e4a2f9 authored by Fugang Duan's avatar Fugang Duan
Browse files

bluetooth: l2cap: add security setting check


Add security setting check for socket interface since
stack will check the return value.

Signed-off-by: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 0ea3f156
No related branches found
No related tags found
No related merge requests found
...@@ -794,8 +794,11 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -794,8 +794,11 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
/*change security for LE channels */ /*change security for LE channels */
if (chan->scid == L2CAP_CID_ATT) { if (chan->scid == L2CAP_CID_ATT) {
if (smp_conn_security(conn->hcon, sec.level)) if (smp_conn_security(conn->hcon, sec.level)) {
err = -EINVAL;
break; break;
}
set_bit(FLAG_PENDING_SECURITY, &chan->flags); set_bit(FLAG_PENDING_SECURITY, &chan->flags);
sk->sk_state = BT_CONFIG; sk->sk_state = BT_CONFIG;
chan->state = BT_CONFIG; chan->state = BT_CONFIG;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment