aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-23 12:42:17 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-23 15:24:25 -0500
commit7be2edbbb87a34fbf1441991a679af94fe1d981d (patch)
tree69ed0f44f3c1148ee4f5abdd807000f1fa40619f /net/bluetooth/hci_event.c
parent0f4bd942f13dd15a1b290953cdd7cd6aca11be1f (diff)
Bluetooth: Ensure hci_conn always contains the local identity address
To be consistent with the remote address info in hci_conn we want it to also contain the local identity address information. This patch updates the code to copy the right values in place whenever an LE connection has been established. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 4327b129d38e..064d619344b3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3625,6 +3625,26 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
3625 } 3625 }
3626 } 3626 }
3627 3627
3628 /* Ensure that the hci_conn contains the identity address type
3629 * regardless of which address the connection was made with.
3630 *
3631 * If the controller has a public BD_ADDR, then by default
3632 * use that one. If this is a LE only controller without
3633 * a public address, default to the static random address.
3634 *
3635 * For debugging purposes it is possible to force
3636 * controllers with a public address to use the static
3637 * random address instead.
3638 */
3639 if (test_bit(HCI_FORCE_STATIC_ADDR, &hdev->dev_flags) ||
3640 !bacmp(&hdev->bdaddr, BDADDR_ANY)) {
3641 bacpy(&conn->src, &hdev->static_addr);
3642 conn->src_type = ADDR_LE_DEV_RANDOM;
3643 } else {
3644 bacpy(&conn->src, &hdev->bdaddr);
3645 conn->src_type = ADDR_LE_DEV_PUBLIC;
3646 }
3647
3628 /* Lookup the identity address from the stored connection 3648 /* Lookup the identity address from the stored connection
3629 * address and address type. 3649 * address and address type.
3630 * 3650 *