Commit 5589fa9c authored by Ville Tervo's avatar Ville Tervo Committed by Gustavo F. Padovan

Bluetooth: Do not send disconn comand over LE links

l2cap over LE links can be disconnected without sending
disconnect command first.
Signed-off-by: default avatarVille Tervo <ville.tervo@nokia.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent b62f328b
...@@ -885,6 +885,8 @@ static void l2cap_sock_cleanup_listen(struct sock *parent) ...@@ -885,6 +885,8 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)
void __l2cap_sock_close(struct sock *sk, int reason) void __l2cap_sock_close(struct sock *sk, int reason)
{ {
struct l2cap_conn *conn = l2cap_pi(sk)->conn;
BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket); BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
switch (sk->sk_state) { switch (sk->sk_state) {
...@@ -894,10 +896,9 @@ void __l2cap_sock_close(struct sock *sk, int reason) ...@@ -894,10 +896,9 @@ void __l2cap_sock_close(struct sock *sk, int reason)
case BT_CONNECTED: case BT_CONNECTED:
case BT_CONFIG: case BT_CONFIG:
if (sk->sk_type == SOCK_SEQPACKET || if ((sk->sk_type == SOCK_SEQPACKET ||
sk->sk_type == SOCK_STREAM) { sk->sk_type == SOCK_STREAM) &&
struct l2cap_conn *conn = l2cap_pi(sk)->conn; conn->hcon->type == ACL_LINK) {
l2cap_sock_set_timer(sk, sk->sk_sndtimeo); l2cap_sock_set_timer(sk, sk->sk_sndtimeo);
l2cap_send_disconn_req(conn, sk, reason); l2cap_send_disconn_req(conn, sk, reason);
} else } else
...@@ -905,9 +906,9 @@ void __l2cap_sock_close(struct sock *sk, int reason) ...@@ -905,9 +906,9 @@ void __l2cap_sock_close(struct sock *sk, int reason)
break; break;
case BT_CONNECT2: case BT_CONNECT2:
if (sk->sk_type == SOCK_SEQPACKET || if ((sk->sk_type == SOCK_SEQPACKET ||
sk->sk_type == SOCK_STREAM) { sk->sk_type == SOCK_STREAM) &&
struct l2cap_conn *conn = l2cap_pi(sk)->conn; conn->hcon->type == ACL_LINK) {
struct l2cap_conn_rsp rsp; struct l2cap_conn_rsp rsp;
__u16 result; __u16 result;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment