summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-06 02:08:36 -0700
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-06 11:13:11 +0200
commitc25dfc610b983f74f05b3c12d9ad4ff4af6cd858 (patch)
tree4f763221a6fd8917613dd78ea4e1f2c2e301879c /net/bluetooth/hci_conn.c
parente8803534a03ddfcb37bd3d6cb981c5131a5bd993 (diff)
downloadlinux-c25dfc610b983f74f05b3c12d9ad4ff4af6cd858.tar.bz2
Bluetooth: Use random address if public address is not available
For single mode LE-only controllers, it is possible that they come without a public address. If a public address is not available, then use the random address for connection establishment and scanning. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8b0d08fb6158..2a220a8c9869 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -59,6 +59,10 @@ static void hci_le_create_connection(struct hci_conn *conn)
cp.scan_window = __constant_cpu_to_le16(0x0030);
bacpy(&cp.peer_addr, &conn->dst);
cp.peer_addr_type = conn->dst_type;
+ if (bacmp(&hdev->bdaddr, BDADDR_ANY))
+ cp.own_address_type = ADDR_LE_DEV_PUBLIC;
+ else
+ cp.own_address_type = ADDR_LE_DEV_RANDOM;
cp.conn_interval_min = __constant_cpu_to_le16(0x0028);
cp.conn_interval_max = __constant_cpu_to_le16(0x0038);
cp.supervision_timeout = __constant_cpu_to_le16(0x002a);