mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-04 21:31:51 +00:00
Bluetooth: Fix connection key type updating for buggy controllers
If a controller generates a changed combination key as its first key the connection key type will not be correctly set. In these situations make sure the update the connection key type when such a buggy controller is detected. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
12adcf3a95
commit
655fe6ece7
1 changed files with 4 additions and 1 deletions
|
@ -1083,8 +1083,11 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
|
||||||
* previous key */
|
* previous key */
|
||||||
if (type == HCI_LK_CHANGED_COMBINATION &&
|
if (type == HCI_LK_CHANGED_COMBINATION &&
|
||||||
(!conn || conn->remote_auth == 0xff) &&
|
(!conn || conn->remote_auth == 0xff) &&
|
||||||
old_key_type == 0xff)
|
old_key_type == 0xff) {
|
||||||
type = HCI_LK_COMBINATION;
|
type = HCI_LK_COMBINATION;
|
||||||
|
if (conn)
|
||||||
|
conn->key_type = type;
|
||||||
|
}
|
||||||
|
|
||||||
if (new_key && !hci_persistent_key(hdev, conn, type, old_key_type)) {
|
if (new_key && !hci_persistent_key(hdev, conn, type, old_key_type)) {
|
||||||
list_del(&key->list);
|
list_del(&key->list);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue