blob: ba1af805d629d04a98df72d666a137446e95b0df [file] [log] [blame]
From 730b618e493cf1d9ee620147ec351fd9387be0cd Mon Sep 17 00:00:00 2001
From: Daniel Winkler <danielwinkler@google.com>
Date: Mon, 14 Dec 2020 10:58:18 -0800
Subject: [PATCH] CHROMIUM: Bluetooth: Ignore global Connectable setting for
extended 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 hatch, 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 hatch.
BUG=b:175069101, b:197529377
TEST=Test Nearby startup flow on hatch, b/197529377#comment22
Signed-off-by: Daniel Winkler <danielwinkler@google.com>
Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Change-Id: I99ea32b02b50ec996239e1a4e489cba47ae90a62
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3507074
Reviewed-by: Alain Michaud <alainm@chromium.org>
(cherry picked from commit 80b9c2bb9400d213327e66e69048edf9d57824ff)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3524281
Reviewed-by: Yun-Hao Chung <howardchung@chromium.org>
Commit-Queue: Yun-Hao Chung <howardchung@chromium.org>
---
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 73573f787a5e6851d771289635840166db25a6f8..b180c0fff709f0ae2a68c85346dd8d5159fe3b7e 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1046,11 +1046,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
flags = hci_adv_instance_flags(hdev, 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 -EPERM;
--
2.38.1.584.g0f3c55d4c2-goog