diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-16 16:11:44 -0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-16 16:11:44 -0300 |
commit | 08e6d907fe606b751adddce54ad8f51e0950bc3f (patch) | |
tree | 1a987f519b1ea706a61cd23d7eeea038dfe81b7a /net/bluetooth/l2cap_sock.c | |
parent | d34c34fb2592bd5231a153ad1676c3ded175410a (diff) | |
parent | 671267bf3aac3dae0555730b07ef29c042e325b2 (diff) | |
download | talos-obmc-linux-08e6d907fe606b751adddce54ad8f51e0950bc3f.tar.gz talos-obmc-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; } |