aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 07fdbc7dd54d..01f750142d55 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1946,11 +1946,14 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
1946 l2cap_pi(sk)->dcid = dcid; 1946 l2cap_pi(sk)->dcid = dcid;
1947 l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT; 1947 l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
1948 1948
1949 l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_CONNECT_PEND;
1950
1949 l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ, 1951 l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ,
1950 l2cap_build_conf_req(sk, req), req); 1952 l2cap_build_conf_req(sk, req), req);
1951 break; 1953 break;
1952 1954
1953 case L2CAP_CR_PEND: 1955 case L2CAP_CR_PEND:
1956 l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
1954 break; 1957 break;
1955 1958
1956 default: 1959 default:
@@ -2478,6 +2481,11 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
2478 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) { 2481 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
2479 bh_lock_sock(sk); 2482 bh_lock_sock(sk);
2480 2483
2484 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND) {
2485 bh_unlock_sock(sk);
2486 continue;
2487 }
2488
2481 if (!status && (sk->sk_state == BT_CONNECTED || 2489 if (!status && (sk->sk_state == BT_CONNECTED ||
2482 sk->sk_state == BT_CONFIG)) { 2490 sk->sk_state == BT_CONFIG)) {
2483 l2cap_check_encryption(sk, encrypt); 2491 l2cap_check_encryption(sk, encrypt);