aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-04-28 14:29:01 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-04-28 15:14:41 -0400
commit655fe6ece7e71b37c17577ae485d11bf701c95f7 (patch)
treeaa57a1796d17c5448d58aec884824d42ecc34468 /net/bluetooth
parent12adcf3a953c3aa4006d855aa638133bf018ceac (diff)
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2ac6036b70c3..59ca4755b6b3 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1083,8 +1083,11 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
1083 * previous key */ 1083 * previous key */
1084 if (type == HCI_LK_CHANGED_COMBINATION && 1084 if (type == HCI_LK_CHANGED_COMBINATION &&
1085 (!conn || conn->remote_auth == 0xff) && 1085 (!conn || conn->remote_auth == 0xff) &&
1086 old_key_type == 0xff) 1086 old_key_type == 0xff) {
1087 type = HCI_LK_COMBINATION; 1087 type = HCI_LK_COMBINATION;
1088 if (conn)
1089 conn->key_type = type;
1090 }
1088 1091
1089 if (new_key && !hci_persistent_key(hdev, conn, type, old_key_type)) { 1092 if (new_key && !hci_persistent_key(hdev, conn, type, old_key_type)) {
1090 list_del(&key->list); 1093 list_del(&key->list);