aboutsummaryrefslogtreecommitdiff
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-13 03:57:39 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:08 +0200
commita6ba44cbb1c0f2612363f361f192220d5e582936 (patch)
tree4ddffc240b6652cecba1c6ff7906c1d9db0b3804 /net/bluetooth/hci_conn.c
parent5659cc0487cf29fe3a8d062461d08edb6dac8116 (diff)
Bluetooth: Store the source address type of LE connections
When establishing LE connections, it is possible to use a public address (if available) or a random address. The type of address is only known when creating connections, so make sure it is stored in hci_conn structure. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Kamal Negi <kamaln@codeaurora.org>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index c9b2d5011..4b4c160a4 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -539,6 +539,15 @@ static struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
le->pending_sec_level = sec_level;
le->auth_type = auth_type;
+ if (dst_type == BDADDR_LE_PUBLIC)
+ le->dst_type = ADDR_LE_DEV_PUBLIC;
+ else
+ le->dst_type = ADDR_LE_DEV_RANDOM;
+
+ if (bacmp(&hdev->bdaddr, BDADDR_ANY))
+ le->src_type = ADDR_LE_DEV_PUBLIC;
+ else
+ le->src_type = ADDR_LE_DEV_RANDOM;
hci_conn_hold(le);