Skip to content

Commit c403da5

Browse files
committed
Bluetooth: ISO: Fix another instance of dst_type handling
Socket dst_type cannot be directly assigned to hci_conn->type since there domain is different which may lead to the wrong address type being used. Fixes: 6a5ad25 ("Bluetooth: ISO: Fix possible circular locking dependency") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent 76e20da commit c403da5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

net/bluetooth/iso.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,13 @@ static void iso_conn_ready(struct iso_conn *conn)
20462046
}
20472047

20482048
bacpy(&iso_pi(sk)->dst, &hcon->dst);
2049-
iso_pi(sk)->dst_type = hcon->dst_type;
2049+
2050+
/* Convert from HCI to three-value type */
2051+
if (hcon->dst_type == ADDR_LE_DEV_PUBLIC)
2052+
iso_pi(sk)->dst_type = BDADDR_LE_PUBLIC;
2053+
else
2054+
iso_pi(sk)->dst_type = BDADDR_LE_RANDOM;
2055+
20502056
iso_pi(sk)->sync_handle = iso_pi(parent)->sync_handle;
20512057
memcpy(iso_pi(sk)->base, iso_pi(parent)->base, iso_pi(parent)->base_len);
20522058
iso_pi(sk)->base_len = iso_pi(parent)->base_len;

0 commit comments

Comments
 (0)