]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Bluetooth: ISO: Fix getname not returning broadcast fields
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 24 Jul 2025 20:36:27 +0000 (16:36 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 15 Aug 2025 13:44:49 +0000 (09:44 -0400)
getname shall return iso_bc fields for both BIS_LINK and PA_LINK since
the likes of bluetoothd do use the getpeername to retrieve the SID both
when enumerating the broadcasters and when synchronizing.

Fixes: a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/iso.c

index 7bd3aa0a6db9ad43e05189f267b9840ec0d94f2d..eaffd25570e3b0014764b217bd40c3484d87ce63 100644 (file)
@@ -1347,7 +1347,7 @@ static int iso_sock_getname(struct socket *sock, struct sockaddr *addr,
                bacpy(&sa->iso_bdaddr, &iso_pi(sk)->dst);
                sa->iso_bdaddr_type = iso_pi(sk)->dst_type;
 
-               if (hcon && hcon->type == BIS_LINK) {
+               if (hcon && (hcon->type == BIS_LINK || hcon->type == PA_LINK)) {
                        sa->iso_bc->bc_sid = iso_pi(sk)->bc_sid;
                        sa->iso_bc->bc_num_bis = iso_pi(sk)->bc_num_bis;
                        memcpy(sa->iso_bc->bc_bis, iso_pi(sk)->bc_bis,