diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-16 21:11:44 +0200 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-16 21:11:44 +0200 |
commit | 08e6d907fe606b751adddce54ad8f51e0950bc3f (patch) | |
tree | 1a987f519b1ea706a61cd23d7eeea038dfe81b7a /net/bluetooth/l2cap_sock.c | |
parent | Bluetooth: Initialize the transmit queue for L2CAP streaming mode (diff) | |
parent | Bluetooth: mgmt: Fix device_connected sending order (diff) | |
download | linux-08e6d907fe606b751adddce54ad8f51e0950bc3f.tar.xz linux-08e6d907fe606b751adddce54ad8f51e0950bc3f.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 6bf8ff75d95f..b7bc7b981ee2 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -596,10 +596,14 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch sk->sk_state = BT_CONFIG; chan->state = BT_CONFIG; - /* or for ACL link, under defer_setup time */ - } else if (sk->sk_state == BT_CONNECT2 && - bt_sk(sk)->defer_setup) { - err = l2cap_chan_check_security(chan); + /* or for ACL link */ + } else if ((sk->sk_state == BT_CONNECT2 && + bt_sk(sk)->defer_setup) || + sk->sk_state == BT_CONNECTED) { + if (!l2cap_chan_check_security(chan)) + bt_sk(sk)->suspended = true; + else + sk->sk_state_change(sk); } else { err = -EINVAL; } |