Skip to content

Commit f67eabf

Browse files
committed
Bluetooth: Fix not notifying when connection encryption changes
Some layers such as SMP depend on getting notified about encryption changes immediately as they only allow certain PDU to be transmitted over an encrypted link which may cause SMP implementation to reject valid PDUs received thus causing pairing to fail when it shouldn't. Fixes: 7aca0ac ("Bluetooth: Wait for HCI_OP_WRITE_AUTH_PAYLOAD_TO to complete") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 64b8bc7 commit f67eabf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

net/bluetooth/hci_event.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,6 @@ static u8 hci_cc_write_auth_payload_timeout(struct hci_dev *hdev, void *data,
820820
if (!rp->status)
821821
conn->auth_payload_timeout = get_unaligned_le16(sent + 2);
822822

823-
hci_encrypt_cfm(conn, 0);
824-
825823
unlock:
826824
hci_dev_unlock(hdev);
827825

@@ -3683,12 +3681,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
36833681
cp.handle = cpu_to_le16(conn->handle);
36843682
cp.timeout = cpu_to_le16(hdev->auth_payload_timeout);
36853683
if (hci_send_cmd(conn->hdev, HCI_OP_WRITE_AUTH_PAYLOAD_TO,
3686-
sizeof(cp), &cp)) {
3684+
sizeof(cp), &cp))
36873685
bt_dev_err(hdev, "write auth payload timeout failed");
3688-
goto notify;
3689-
}
3690-
3691-
goto unlock;
36923686
}
36933687

36943688
notify:

0 commit comments

Comments
 (0)