|
@@ -2062,6 +2062,12 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
|
|
|
|
|
|
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
|
|
clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
|
|
|
|
|
|
|
|
+ if (ev->status && conn->state == BT_CONNECTED) {
|
|
|
|
+ hci_acl_disconn(conn, 0x13);
|
|
|
|
+ hci_conn_put(conn);
|
|
|
|
+ goto unlock;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (conn->state == BT_CONFIG) {
|
|
if (conn->state == BT_CONFIG) {
|
|
if (!ev->status)
|
|
if (!ev->status)
|
|
conn->state = BT_CONNECTED;
|
|
conn->state = BT_CONNECTED;
|
|
@@ -2072,6 +2078,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
|
|
hci_encrypt_cfm(conn, ev->status, ev->encrypt);
|
|
hci_encrypt_cfm(conn, ev->status, ev->encrypt);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+unlock:
|
|
hci_dev_unlock(hdev);
|
|
hci_dev_unlock(hdev);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2125,7 +2132,7 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff
|
|
goto unlock;
|
|
goto unlock;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!ev->status) {
|
|
|
|
|
|
+ if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
|
|
struct hci_cp_remote_name_req cp;
|
|
struct hci_cp_remote_name_req cp;
|
|
memset(&cp, 0, sizeof(cp));
|
|
memset(&cp, 0, sizeof(cp));
|
|
bacpy(&cp.bdaddr, &conn->dst);
|
|
bacpy(&cp.bdaddr, &conn->dst);
|
|
@@ -2901,7 +2908,7 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b
|
|
if (conn->state != BT_CONFIG)
|
|
if (conn->state != BT_CONFIG)
|
|
goto unlock;
|
|
goto unlock;
|
|
|
|
|
|
- if (!ev->status) {
|
|
|
|
|
|
+ if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
|
|
struct hci_cp_remote_name_req cp;
|
|
struct hci_cp_remote_name_req cp;
|
|
memset(&cp, 0, sizeof(cp));
|
|
memset(&cp, 0, sizeof(cp));
|
|
bacpy(&cp.bdaddr, &conn->dst);
|
|
bacpy(&cp.bdaddr, &conn->dst);
|