提交 2526d3d8 编写于 作者: M Marcel Holtmann

Bluetooth: Permit BT_SECURITY also for L2CAP raw sockets

Userspace pairing code can be simplified if it doesn't have to fall
back to using L2CAP_LM in the case of L2CAP raw sockets. This patch
allows the BT_SECURITY socket option to be used for these sockets.
Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 37e62f55
...@@ -1308,7 +1308,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch ...@@ -1308,7 +1308,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch
switch (optname) { switch (optname) {
case BT_SECURITY: case BT_SECURITY:
if (sk->sk_type != SOCK_SEQPACKET) { if (sk->sk_type != SOCK_SEQPACKET && sk->sk_type != SOCK_RAW) {
err = -EINVAL; err = -EINVAL;
break; break;
} }
...@@ -1455,7 +1455,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch ...@@ -1455,7 +1455,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch
switch (optname) { switch (optname) {
case BT_SECURITY: case BT_SECURITY:
if (sk->sk_type != SOCK_SEQPACKET) { if (sk->sk_type != SOCK_SEQPACKET && sk->sk_type != SOCK_RAW) {
err = -EINVAL; err = -EINVAL;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册