From 16114e5e1111c5d3fc6b43e816daaaa89726532b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 10 Feb 2009 17:59:57 +0200 Subject: Always store the link key when we initiate dedicated bonding --- src/dbus-hci.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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, -- cgit