aboutsummaryrefslogtreecommitdiff
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-27 14:05:41 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-02-27 08:50:21 -0800
commita1f4c3188bb4d51a41d2026ee08a578f56c61e47 (patch)
tree09ece6c79d3caee868ee9a9ad5df23f2947cf140 /net/bluetooth/hci_event.c
parent56ed2cb88c7370d5aa88c92a2a0b1cb92c0979b9 (diff)
Bluetooth: Add hci_copy_identity_address convenience function
The number of places needing the local Identity Address are starting to grow so it's better to have a single place for the logic of determining it. This patch adds a convenience function for getting the Identity Address and updates the two current places needing this to use it. 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.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index f26e91f7293..162235633bf 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3665,23 +3665,8 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
/* Ensure that the hci_conn contains the identity address type
* regardless of which address the connection was made with.
- *
- * If the controller has a public BD_ADDR, then by default
- * use that one. If this is a LE only controller without
- * a public address, default to the static random address.
- *
- * For debugging purposes it is possible to force
- * controllers with a public address to use the static
- * random address instead.
*/
- if (test_bit(HCI_FORCE_STATIC_ADDR, &hdev->dev_flags) ||
- !bacmp(&hdev->bdaddr, BDADDR_ANY)) {
- bacpy(&conn->src, &hdev->static_addr);
- conn->src_type = ADDR_LE_DEV_RANDOM;
- } else {
- bacpy(&conn->src, &hdev->bdaddr);
- conn->src_type = ADDR_LE_DEV_PUBLIC;
- }
+ hci_copy_identity_address(hdev, &conn->src, &conn->src_type);
/* Lookup the identity address from the stored connection
* address and address type.