aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorVille Tervo <ville.tervo@nokia.com>2011-02-10 20:38:51 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-16 14:33:06 -0500
commit5589fa9c2d2b8c134f44db36892ccc500aac3147 (patch)
tree6f24b448f1ac225e574dcb3eefaf921c949dd5b8 /net/bluetooth
parentb62f328b8f20abe97cdbaaf44c6e4f5e7a610f18 (diff)
Bluetooth: Do not send disconn comand over LE links
l2cap over LE links can be disconnected without sending disconnect command first. Signed-off-by: Ville Tervo <ville.tervo@nokia.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_sock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index a8d289373794..484e717da79e 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -885,6 +885,8 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)
885 885
886void __l2cap_sock_close(struct sock *sk, int reason) 886void __l2cap_sock_close(struct sock *sk, int reason)
887{ 887{
888 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
889
888 BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket); 890 BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
889 891
890 switch (sk->sk_state) { 892 switch (sk->sk_state) {
@@ -894,10 +896,9 @@ void __l2cap_sock_close(struct sock *sk, int reason)
894 896
895 case BT_CONNECTED: 897 case BT_CONNECTED:
896 case BT_CONFIG: 898 case BT_CONFIG:
897 if (sk->sk_type == SOCK_SEQPACKET || 899 if ((sk->sk_type == SOCK_SEQPACKET ||
898 sk->sk_type == SOCK_STREAM) { 900 sk->sk_type == SOCK_STREAM) &&
899 struct l2cap_conn *conn = l2cap_pi(sk)->conn; 901 conn->hcon->type == ACL_LINK) {
900
901 l2cap_sock_set_timer(sk, sk->sk_sndtimeo); 902 l2cap_sock_set_timer(sk, sk->sk_sndtimeo);
902 l2cap_send_disconn_req(conn, sk, reason); 903 l2cap_send_disconn_req(conn, sk, reason);
903 } else 904 } else
@@ -905,9 +906,9 @@ void __l2cap_sock_close(struct sock *sk, int reason)
905 break; 906 break;
906 907
907 case BT_CONNECT2: 908 case BT_CONNECT2:
908 if (sk->sk_type == SOCK_SEQPACKET || 909 if ((sk->sk_type == SOCK_SEQPACKET ||
909 sk->sk_type == SOCK_STREAM) { 910 sk->sk_type == SOCK_STREAM) &&
910 struct l2cap_conn *conn = l2cap_pi(sk)->conn; 911 conn->hcon->type == ACL_LINK) {
911 struct l2cap_conn_rsp rsp; 912 struct l2cap_conn_rsp rsp;
912 __u16 result; 913 __u16 result;
913 914