blob: 7cd6a1be5dd7a445adc1941ca1a8d6253c0fa33b [file] [log] [blame]
From a2f116f49411a001085e0ff0554b18f28f224d4d 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_request.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index f70432a38d4b..538a21fa6eed 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1541,11 +1541,7 @@ void __hci_req_enable_advertising(struct hci_request *req)
flags = get_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;
--
2.17.1