summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-10 17:59:57 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-10 18:00:55 +0200
commit16114e5e1111c5d3fc6b43e816daaaa89726532b (patch)
treeaa3400db3b952f024ec00a41cb2e88b32e7210ac /src
parent28faab63be1eb83bf26f394552f46bce1b1d4114 (diff)
Always store the link key when we initiate dedicated bonding
Diffstat (limited to 'src')
-rw-r--r--src/dbus-hci.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index f0c057ee..72e691bd 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -917,10 +917,16 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
get_auth_requirements(local, peer, &local_auth);
remote_auth = device_get_auth(device);
- /* Only store the link key if neither side had "no bonding" as a
- * requirement */
+ /* Only store the link key if one of the following is true:
+ * 1. this is a legacy link key
+ * 2. this is a changed combination key and there was a previously
+ * stored one
+ * 3. neither local nor remote side had no-bonding as a requirement
+ * 4. the local side had dedicated bonding as a requirement
+ */
if (key_type < 0x03 || (key_type == 0x06 && old_key_type != 0xff) ||
- (local_auth > 0x01 && remote_auth > 0x01)) {
+ (local_auth > 0x01 && remote_auth > 0x01) ||
+ (local_auth == 0x02 || local_auth == 0x03)) {
int err;
err = write_link_key(local, peer, key, new_key_type,