summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-07-29 16:32:36 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-07-29 16:32:36 +0200
commita1ae52c203417a4e6aca01a5e8955d74fc7b3d0a (patch)
tree48ac79fee7d145f0c31c28bb09c9c066caf48170 /net/bluetooth/smp.c
parentMerge tag 'for-linville-20140725' of git://github.com/kvalo/ath (diff)
parentBluetooth: Fix incorrectly disabling page scan when toggling connectable (diff)
downloadlinux-a1ae52c203417a4e6aca01a5e8955d74fc7b3d0a.tar.xz
linux-a1ae52c203417a4e6aca01a5e8955d74fc7b3d0a.zip
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r--net/bluetooth/smp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index e49c83d8b957..a7c344b4acbc 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1291,6 +1291,22 @@ static void smp_notify_keys(struct l2cap_conn *conn)
bacpy(&hcon->dst, &smp->remote_irk->bdaddr);
hcon->dst_type = smp->remote_irk->addr_type;
l2cap_conn_update_id_addr(hcon);
+
+ /* When receiving an indentity resolving key for
+ * a remote device that does not use a resolvable
+ * private address, just remove the key so that
+ * it is possible to use the controller white
+ * list for scanning.
+ *
+ * Userspace will have been told to not store
+ * this key at this point. So it is safe to
+ * just remove it.
+ */
+ if (!bacmp(&smp->remote_irk->rpa, BDADDR_ANY)) {
+ list_del(&smp->remote_irk->list);
+ kfree(smp->remote_irk);
+ smp->remote_irk = NULL;
+ }
}
/* The LTKs and CSRKs should be persistent only if both sides