Skip to content

Commit 78729f4

Browse files
alexsvennashif
authored andcommitted
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 <alexander.svensen@nordicsemi.no>
1 parent d78a9ba commit 78729f4

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
@@ -148,7 +148,7 @@ static bool bis_syncs_unique_or_no_pref(uint32_t requested_bis_syncs,
148148
return true;
149149
}
150150

151-
return (requested_bis_syncs & aggregated_bis_syncs) != 0U;
151+
return (requested_bis_syncs & aggregated_bis_syncs) == 0U;
152152
}
153153

154154
static bool valid_bis_sync_request(uint32_t requested_bis_syncs, uint32_t aggregated_bis_syncs)
@@ -850,8 +850,7 @@ static int scan_delegator_mod_src(struct bt_conn *conn,
850850
bis_sync_change_requested = true;
851851
}
852852

853-
if (!valid_bis_sync_request(internal_state->requested_bis_sync[i],
854-
aggregated_bis_syncs)) {
853+
if (!valid_bis_sync_request(requested_bis_sync[i], aggregated_bis_syncs)) {
855854
LOG_DBG("Invalid BIS Sync request[%d]", i);
856855
ret = BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED);
857856
goto unlock_return;

0 commit comments

Comments
 (0)