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>
This commit is contained in:
committed by
Gustavo F. Padovan
parent
8556edd32f
commit
d00ef24fc2
@@ -1106,6 +1106,7 @@ static int l2cap_do_connect(struct sock *sk)
|
|||||||
if (sk->sk_type != SOCK_SEQPACKET &&
|
if (sk->sk_type != SOCK_SEQPACKET &&
|
||||||
sk->sk_type != SOCK_STREAM) {
|
sk->sk_type != SOCK_STREAM) {
|
||||||
l2cap_sock_clear_timer(sk);
|
l2cap_sock_clear_timer(sk);
|
||||||
|
if (l2cap_check_security(sk))
|
||||||
sk->sk_state = BT_CONNECTED;
|
sk->sk_state = BT_CONNECTED;
|
||||||
} else
|
} else
|
||||||
l2cap_do_start(sk);
|
l2cap_do_start(sk);
|
||||||
|
Reference in New Issue
Block a user