blob: c51528d3923ac9658fb3ff95e405593c99e6ff6a [file] [log] [blame]
From 9c4c3037ceb4b82aa63ec5345d87a05945c22e13 Mon Sep 17 00:00:00 2001
From: Daniel Winkler <danielwinkler@google.com>
Date: Tue, 8 Dec 2020 11:27:04 -0800
Subject: [PATCH] CHROMIUM: Bluetooth: Ignore global Connectable setting for
broadcast adv
Existing logic enforces a "connectable" advertisement if the global
Connectable setting is active, even if the advertisement requested was
non-connectable. This can cause a case where the client requires a
random address, but kernel will ignore that request. This patch removes
the check for the global setting, to ensure we provide a random address
if the client did not specify Connectability in their advertisement
request.
Specifically, this seems to break bluetooth discovery on Atlas, as
Nearby immediately requests an advertisement on login. The global
Connectable setting makes this advertisement public (not good), and then
future discovery requests fail because the random address update is
skipped since adv is enabled.
Change was tested by verifying Nearby startup flow, and ensuring
both the scanning and advertising steps succeed on atlas.
BUG=b:175069101
TEST=Test Nearby startup flow on atlas
Signed-off-by: Daniel Winkler <danielwinkler@google.com>
Change-Id: I0b9f8e1f8be0af88ae381baa1da89cfa6d79e7d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2580543
Reviewed-by: Alain Michaud <alainm@chromium.org>
Commit-Queue: Daniel Winkler <danielwinkler@google.com>
Tested-by: Daniel Winkler <danielwinkler@google.com>
---
net/bluetooth/hci_sync.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 76c3107c9f91f4172612fe9bb5145ee458f6c576..73573f787a5e6851d771289635840166db25a6f8 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1499,11 +1499,7 @@ int hci_enable_advertising_sync(struct hci_dev *hdev)
flags = hci_adv_instance_flags(hdev, hdev->cur_adv_instance);
adv_instance = hci_find_adv_instance(hdev, hdev->cur_adv_instance);
- /* If the "connectable" instance flag was not set, then choose between
- * ADV_IND and ADV_NONCONN_IND based on the global connectable setting.
- */
- connectable = (flags & MGMT_ADV_FLAG_CONNECTABLE) ||
- mgmt_get_connectable(hdev);
+ connectable = (flags & MGMT_ADV_FLAG_CONNECTABLE);
if (!is_advertising_allowed(hdev, connectable))
return -EINVAL;
--
2.38.1.584.g0f3c55d4c2-goog