Skip to content

Commit cc233f1

Browse files
alexsvenkoffes
authored andcommitted
[nrf fromtree] bluetooth: audio: scan_delegator: Fix validation
- Fixes bug where bis_sync_requests were wrongfully validated. - Two BISes across subgroups should not have the same bits set - Remove use of internal->bis_syncs before it's updated in mod_src. Signed-off-by: Alexander Svensen <[email protected]> (cherry picked from commit 78729f4)
1 parent ec5a523 commit cc233f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

subsys/bluetooth/audio/bap_scan_delegator.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static bool bis_syncs_unique_or_no_pref(uint32_t requested_bis_syncs,
149149
return true;
150150
}
151151

152-
return (requested_bis_syncs & aggregated_bis_syncs) != 0U;
152+
return (requested_bis_syncs & aggregated_bis_syncs) == 0U;
153153
}
154154

155155
static bool valid_bis_sync_request(uint32_t requested_bis_syncs, uint32_t aggregated_bis_syncs)
@@ -938,8 +938,7 @@ static int scan_delegator_mod_src(struct bt_conn *conn,
938938
bis_sync_change_requested = true;
939939
}
940940

941-
if (!valid_bis_sync_request(internal_state->requested_bis_sync[i],
942-
aggregated_bis_syncs)) {
941+
if (!valid_bis_sync_request(requested_bis_sync[i], aggregated_bis_syncs)) {
943942
LOG_DBG("Invalid BIS Sync request[%d]", i);
944943
ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED);
945944
goto unlock_return;

0 commit comments

Comments
 (0)