summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-06 09:28:24 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-06 09:28:24 -0800
commite136183fa06312d126c34c90ce725017f2ef8f90 (patch)
tree2d38d3b8ee01abea315353b66b1ac4e778150708 /src
parentfb6feead6323073b28fc8147aae5c211894d139d (diff)
Don't changed combination keys for no-bonding
Diffstat (limited to 'src')
-rw-r--r--src/dbus-hci.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index ac44abe1..45f65f1d 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -917,8 +917,11 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
/* Only store the link key if neither side had "no bonding" as a
* requirement */
- if (key_type == 0x06 || (local_auth > 0x01 && remote_auth > 0x01)) {
- int err = write_link_key(local, peer, key, new_key_type, pin_length);
+ if ((key_type == 0x06 && old_key_type != 0xff) ||
+ (local_auth > 0x01 && remote_auth > 0x01)) {
+ int err;
+
+ err = write_link_key(local, peer, key, new_key_type, pin_length);
if (err < 0) {
error("write_link_key: %s (%d)", strerror(-err), -err);
return err;