Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions subsys/bluetooth/host/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3117,9 +3117,9 @@ static int bt_l2cap_dyn_chan_send(struct bt_l2cap_le_chan *le_chan, struct net_b
return -EINVAL;
}

CHECKIF(user_data_not_empty(buf)) {
LOG_DBG("Please clear user_data first");
return -EINVAL;
if (user_data_not_empty(buf)) {
/* There may be issues if user_data is not empty. */
LOG_WRN("user_data is not empty");
}

/* Prepend SDU length.
Expand Down
1 change: 0 additions & 1 deletion tests/bsim/bluetooth/host/l2cap/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ source ${ZEPHYR_BASE}/tests/bsim/compile.source
app=tests/bsim/bluetooth/host/l2cap/many_conns compile
app=tests/bsim/bluetooth/host/l2cap/general compile
app=tests/bsim/bluetooth/host/l2cap/userdata compile
app=tests/bsim/bluetooth/host/l2cap/userdata conf_file=prj_no_checks.conf compile
app=tests/bsim/bluetooth/host/l2cap/stress compile
app=tests/bsim/bluetooth/host/l2cap/stress conf_file=prj_nofrag.conf compile
app=tests/bsim/bluetooth/host/l2cap/stress conf_file=prj_syswq.conf compile
Expand Down
16 changes: 0 additions & 16 deletions tests/bsim/bluetooth/host/l2cap/userdata/prj_no_checks.conf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -258,20 +258,7 @@ static void test_central_main(void)
*/
err = bt_l2cap_chan_send(&channel.chan, buf);

if (has_checks) {
/* The stack is supposed to reject `buf` if it has non-null
* user_data.
*/
if (err == -EINVAL) {
PASS("(Enabled-checks) Test passed\n");
return;
}

FAIL("Expected EINVAL (%d) got %d\n", -EINVAL, err);
}

/* We have bypassed runtime checks of user_data. L2CAP will take our
* `buf` with non-null user_data. We verify that:
/* L2CAP will take our `buf` with non-null user_data. We verify that:
* - it is cleared
* - we don't segfault later (e.g. in `tx_notify`)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ INCR_BUILD=1
source ${ZEPHYR_BASE}/tests/bsim/compile.source

app="$(guess_test_relpath)" compile
app="$(guess_test_relpath)" conf_file=prj_no_checks.conf compile

wait_for_background_jobs
11 changes: 0 additions & 11 deletions tests/bsim/bluetooth/host/l2cap/userdata/tests_scripts/l2cap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,3 @@ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=5e6 $@

wait_for_background_jobs

Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_l2cap_userdata_prj_no_checks_conf \
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central

Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_l2cap_userdata_prj_no_checks_conf \
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral

Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=5e6 $@

wait_for_background_jobs