]> Gentwo Git Trees - linux/.git/commitdiff
Bluetooth: ISO: Fix not updating BIS sender source address
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 6 Oct 2025 20:53:35 +0000 (16:53 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 1 Dec 2025 21:00:06 +0000 (16:00 -0500)
The source address for a BIS sender/Broadcast Source shall be updated
with the advertisement address since in case privacy is enabled it may
use an RPA rather than an identity address.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/iso.c

index fd56eebe924568baeda8539991e102670aa75dc7..4bce03c8a8d30f9ced4006970109fe855165794d 100644 (file)
@@ -2034,6 +2034,25 @@ static void iso_conn_ready(struct iso_conn *conn)
        BT_DBG("conn %p", conn);
 
        if (sk) {
+               /* Attempt to update source address in case of BIS Sender if
+                * the advertisement is using a random address.
+                */
+               if (conn->hcon->type == BIS_LINK &&
+                   conn->hcon->role == HCI_ROLE_MASTER &&
+                   !bacmp(&conn->hcon->dst, BDADDR_ANY)) {
+                       struct hci_conn *bis = conn->hcon;
+                       struct adv_info *adv;
+
+                       adv = hci_find_adv_instance(bis->hdev,
+                                                   bis->iso_qos.bcast.bis);
+                       if (adv && bacmp(&adv->random_addr, BDADDR_ANY)) {
+                               lock_sock(sk);
+                               iso_pi(sk)->src_type = BDADDR_LE_RANDOM;
+                               bacpy(&iso_pi(sk)->src, &adv->random_addr);
+                               release_sock(sk);
+                       }
+               }
+
                iso_sock_ready(conn->sk);
        } else {
                hcon = conn->hcon;