Skip to content

Commit 03ddb4a

Browse files
committed
Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements
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: eca0ae4 ("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>
1 parent 5bf863f commit 03ddb4a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

net/bluetooth/hci_sync.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
13251325
{
13261326
struct hci_cp_le_set_ext_adv_params cp;
13271327
struct hci_rp_le_set_ext_adv_params rp;
1328-
bool connectable;
1328+
bool connectable, require_privacy;
13291329
u32 flags;
13301330
bdaddr_t random_addr;
13311331
u8 own_addr_type;
@@ -1363,10 +1363,12 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
13631363
return -EPERM;
13641364

13651365
/* Set require_privacy to true only when non-connectable
1366-
* advertising is used. In that case it is fine to use a
1367-
* non-resolvable private address.
1366+
* advertising is used and it is not periodic.
1367+
* In that case it is fine to use a non-resolvable private address.
13681368
*/
1369-
err = hci_get_random_address(hdev, !connectable,
1369+
require_privacy = !connectable && !(adv && adv->periodic);
1370+
1371+
err = hci_get_random_address(hdev, require_privacy,
13701372
adv_use_rpa(hdev, flags), adv,
13711373
&own_addr_type, &random_addr);
13721374
if (err < 0)

0 commit comments

Comments
 (0)