From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> The advertisement data size of broadcast announcement is always set to the maximum rather than the actual size: Before: < HCI Command: LE Set Exte.. (0x08|0x0037) plen 11 Handle: 0x01 Operation: Complete extended advertising data (0x03) Fragment preference: Minimize fragmentation (0x01) Data length: 0xfb Service Data: Broadcast Audio Announcement (0x1852) Broadcast ID: 4734947 (0x483fe3) After: < HCI Command: LE Set Exte.. (0x08|0x0037) plen 11 Handle: 0x01 Operation: Complete extended advertising data (0x03) Fragment preference: Minimize fragmentation (0x01) Data length: 0x07 Service Data: Broadcast Audio Announcement (0x1852) Broadcast ID: 4734947 (0x483fe3) Link: https://github.com/bluez/bluez/issues/1117#issuecomment-2959262176 Fixes: b4da091fed83 ("Bluetooth: hci_sync: Fix broadcast/PA when using an existing instance") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> --- net/bluetooth/hci_sync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 3d4370c7c26d..5e7eac1c3529 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1590,7 +1590,8 @@ static int hci_adv_bcast_annoucement(struct hci_dev *hdev, struct adv_info *adv) get_random_bytes(bid, sizeof(bid)); len = eir_append_service_data(ad, 0, 0x1852, bid, sizeof(bid)); memcpy(ad + len, adv->adv_data, adv->adv_data_len); - hci_set_adv_instance_data(hdev, adv->instance, sizeof(ad), ad, 0, NULL); + hci_set_adv_instance_data(hdev, adv->instance, len + adv->adv_data_len, + ad, 0, NULL); return hci_update_adv_data_sync(hdev, adv->instance); } -- 2.49.0