diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-28 10:54:17 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2012-01-02 22:38:37 -0500 |
commit | 3542b854bc26e5f8e42e0eab4d7f7453b74a362d (patch) | |
tree | 1958fa65523d15edec3813a664a6199e90727254 /net | |
parent | 333055f2aaabadb951b5ecd90f6a20a9aee38c29 (diff) |
Bluetooth: Keep chan->state and sk->sk_state in sync
Those vars need to be in sync, otherwise l2cap_core.c can get the wrong
state.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 9ca5616166f7..c61d967012b2 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -587,6 +587,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
587 | if (smp_conn_security(conn, sec.level)) | 587 | if (smp_conn_security(conn, sec.level)) |
588 | break; | 588 | break; |
589 | sk->sk_state = BT_CONFIG; | 589 | sk->sk_state = BT_CONFIG; |
590 | chan->state = BT_CONFIG; | ||
590 | 591 | ||
591 | /* or for ACL link, under defer_setup time */ | 592 | /* or for ACL link, under defer_setup time */ |
592 | } else if (sk->sk_state == BT_CONNECT2 && | 593 | } else if (sk->sk_state == BT_CONNECT2 && |
@@ -731,6 +732,7 @@ static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct ms | |||
731 | 732 | ||
732 | if (sk->sk_state == BT_CONNECT2 && bt_sk(sk)->defer_setup) { | 733 | if (sk->sk_state == BT_CONNECT2 && bt_sk(sk)->defer_setup) { |
733 | sk->sk_state = BT_CONFIG; | 734 | sk->sk_state = BT_CONFIG; |
735 | pi->chan->state = BT_CONFIG; | ||
734 | 736 | ||
735 | __l2cap_connect_rsp_defer(pi->chan); | 737 | __l2cap_connect_rsp_defer(pi->chan); |
736 | release_sock(sk); | 738 | release_sock(sk); |