Skip to content

Commit

Permalink
Bluetooth: Permit BT_SECURITY also for L2CAP raw sockets
Browse files Browse the repository at this point in the history
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: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Marcel Holtmann committed Feb 27, 2009
1 parent 37e62f5 commit 2526d3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch

switch (optname) {
case BT_SECURITY:
if (sk->sk_type != SOCK_SEQPACKET) {
if (sk->sk_type != SOCK_SEQPACKET && sk->sk_type != SOCK_RAW) {
err = -EINVAL;
break;
}
Expand Down Expand Up @@ -1455,7 +1455,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch

switch (optname) {
case BT_SECURITY:
if (sk->sk_type != SOCK_SEQPACKET) {
if (sk->sk_type != SOCK_SEQPACKET && sk->sk_type != SOCK_RAW) {
err = -EINVAL;
break;
}
Expand Down

0 comments on commit 2526d3d

Please sign in to comment.