summaryrefslogtreecommitdiff
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-02-24 04:25:54 (GMT)
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-24 06:45:58 (GMT)
commit94b1fc92cd7cf550460ffd4bcc08c2707564aa49 (patch)
tree6288fa61c03d3139540e007ccdb2fa6c9d30dbbf /net/bluetooth/mgmt.c
parentac345813c4ac5a0e66261e9812f0fe94729c0eb2 (diff)
downloadlinux-94b1fc92cd7cf550460ffd4bcc08c2707564aa49.tar.xz
Bluetooth: Use unresolvable private address for active scanning
When running active scanning during LE discovery, do not reveal the own identity to the peer devices. In case LE privacy has been enabled, then a resolvable private address is used. If the LE privacy option is off, then use an unresolvable private address. The public address or static random address is never used in active scanning anymore. This ensures that scan request are send using a random address. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 37305fa..5d309d4 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -844,7 +844,7 @@ static void enable_advertising(struct hci_request *req)
memset(&cp, 0, sizeof(cp));
- if (hci_update_random_address(req, &own_addr_type) < 0)
+ if (hci_update_random_address(req, false, &own_addr_type) < 0)
return;
cp.min_interval = __constant_cpu_to_le16(0x0800);
@@ -3389,7 +3389,11 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
memset(&param_cp, 0, sizeof(param_cp));
- err = hci_update_random_address(&req, &own_addr_type);
+ /* All active scans will be done with either a resolvable
+ * private address (when privacy feature has been enabled)
+ * or unresolvable private address.
+ */
+ err = hci_update_random_address(&req, true, &own_addr_type);
if (err < 0) {
err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY,
MGMT_STATUS_FAILED);