diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-01-19 01:36:51 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-01-19 11:40:43 -0500 |
commit | d00ef24fc2923b65fdd440dc6445903e965841ac (patch) | |
tree | 679ed038188e94ddde990e3ec1d31fc56055f9bf /net | |
parent | 8556edd32f01c50a3c99e44dc2c3b1252ea59605 (diff) |
Bluetooth: Fix authentication request for L2CAP raw sockets
When there is an existing connection l2cap_check_security needs to be
called to ensure that the security level of the new socket is fulfilled.
Normally l2cap_do_start takes care of this, but that function doesn't
get called for SOCK_RAW type sockets. This patch adds the necessary
l2cap_check_security call to the appropriate branch in l2cap_do_connect.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index ae227bf25563..7550abb0c96a 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -1106,7 +1106,8 @@ static int l2cap_do_connect(struct sock *sk) | |||
1106 | if (sk->sk_type != SOCK_SEQPACKET && | 1106 | if (sk->sk_type != SOCK_SEQPACKET && |
1107 | sk->sk_type != SOCK_STREAM) { | 1107 | sk->sk_type != SOCK_STREAM) { |
1108 | l2cap_sock_clear_timer(sk); | 1108 | l2cap_sock_clear_timer(sk); |
1109 | sk->sk_state = BT_CONNECTED; | 1109 | if (l2cap_check_security(sk)) |
1110 | sk->sk_state = BT_CONNECTED; | ||
1110 | } else | 1111 | } else |
1111 | l2cap_do_start(sk); | 1112 | l2cap_do_start(sk); |
1112 | } | 1113 | } |