From: Andre Guedes Date: Wed, 26 Feb 2014 23:21:53 +0000 (-0300) Subject: Bluetooth: Support resolvable private addresses X-Git-Tag: v3.15-rc1~113^2~18^2^2~46^2~48 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5b906a84a5b3458d810a9faab74783525f4a84d7;p=uclinux-h8%2Flinux.git Bluetooth: Support resolvable private addresses Only identity addresses are inserted into hdev->pend_le_conns. So, in order to support resolvable private addresses in auto connection mechanism, we should resolve the address before checking for pending connections. Thus, this patch adds an extra check in check_pending_le_conn() and updates 'addr' and 'addr_type' variables before hci_pend_le_conn_ lookup(). Signed-off-by: Andre Guedes Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 46da8b6f4368..cda92db2a9fc 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3706,6 +3706,16 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type) { struct hci_conn *conn; + struct smp_irk *irk; + + /* If this is a resolvable address, we should resolve it and then + * update address and address type variables. + */ + irk = hci_get_irk(hdev, addr, addr_type); + if (irk) { + addr = &irk->bdaddr; + addr_type = irk->addr_type; + } if (!hci_pend_le_conn_lookup(hdev, addr, addr_type)) return;