Skip to content

Commit 1dc98dd

Browse files
Thalleyjhedberg
authored andcommitted
Bluetooth: BAP: Add check to verify that eps have correct iso
Add a check that verifies that 2 endpoints from different connection don't share a CIS, which would be invalid. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 4f2ef51 commit 1dc98dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

subsys/bluetooth/audio/bap_unicast_client.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,6 +3355,8 @@ int bt_bap_unicast_client_qos(struct bt_conn *conn, struct bt_bap_unicast_group
33553355
sink_pd = group->sink_pd;
33563356

33573357
SYS_SLIST_FOR_EACH_CONTAINER(&group->streams, stream, _node) {
3358+
const struct bt_bap_ep *paired_ep;
3359+
33583360
if (stream->conn != conn) {
33593361
/* Channel not part of this ACL, skip */
33603362
continue;
@@ -3366,6 +3368,17 @@ int bt_bap_unicast_client_qos(struct bt_conn *conn, struct bt_bap_unicast_group
33663368
return -EINVAL;
33673369
}
33683370

3371+
paired_ep = bt_bap_iso_get_paired_ep(ep);
3372+
if (paired_ep != NULL && paired_ep->stream != NULL &&
3373+
paired_ep->stream->conn != NULL && paired_ep->stream->conn != stream->conn) {
3374+
LOG_DBG("Misconfigured group %p: Stream %p has endpoint %p for conn %p "
3375+
"paired with endpoint %p for conn %p",
3376+
group, stream, ep, stream->conn, paired_ep,
3377+
paired_ep->stream->conn);
3378+
3379+
return -EINVAL;
3380+
}
3381+
33693382
/* Can only be done if all the streams are in the codec
33703383
* configured state or the QoS configured state
33713384
*/

0 commit comments

Comments
 (0)