diff options
| author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2025-09-19 12:30:05 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-15 11:58:05 +0200 |
| commit | 2ef583b45fe767ed16bc043fafadb2e302758a55 (patch) | |
| tree | 9e480bdcfeb0e35061bb461722b5f904b3cc5e95 | |
| parent | 8fd355f54a62b75c6c6f6c01c4003ed57c4365ef (diff) | |
| download | linux-2ef583b45fe767ed16bc043fafadb2e302758a55.tar.gz linux-2ef583b45fe767ed16bc043fafadb2e302758a55.tar.bz2 linux-2ef583b45fe767ed16bc043fafadb2e302758a55.zip | |
Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements
[ Upstream commit 03ddb4ac251463ec5b7b069395d9ab89163dd56c ]
When creating an advertisement for BIG the address shall not be
non-resolvable since in case of acting as BASS/Broadcast Assistant the
address must be the same as the connection in order to use the PAST
method and even when PAST/BASS are not in the picture a Periodic
Advertisement can still be synchronized thus the same argument as to
connectable advertisements still stand.
Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | net/bluetooth/hci_sync.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index dc9209f9f1a6..a128e5709fa1 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1347,7 +1347,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance) { struct hci_cp_le_set_ext_adv_params cp; struct hci_rp_le_set_ext_adv_params rp; - bool connectable; + bool connectable, require_privacy; u32 flags; bdaddr_t random_addr; u8 own_addr_type; @@ -1385,10 +1385,12 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance) return -EPERM; /* Set require_privacy to true only when non-connectable - * advertising is used. In that case it is fine to use a - * non-resolvable private address. + * advertising is used and it is not periodic. + * In that case it is fine to use a non-resolvable private address. */ - err = hci_get_random_address(hdev, !connectable, + require_privacy = !connectable && !(adv && adv->periodic); + + err = hci_get_random_address(hdev, require_privacy, adv_use_rpa(hdev, flags), adv, &own_addr_type, &random_addr); if (err < 0) |
