-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth: Host: Fix L2CAP EINPROGRESS refs #76835
Bluetooth: Host: Fix L2CAP EINPROGRESS refs #76835
Conversation
1867fcb
to
9f2dc36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also clean-up and submit the test that found the bug.
GitHub doesn't allow me to do inline review of commit messages, so I'll do it here:
The second function reference there should be |
2da64d7
to
9f9052e
Compare
9f9052e
to
6f00334
Compare
Added test and fixed the commented-on issues. |
6f00334
to
ae2630d
Compare
tests/bsim/bluetooth/host/l2cap/einprogress/tester/CMakeLists.txt
Outdated
Show resolved
Hide resolved
tests/bsim/bluetooth/host/l2cap/einprogress/tester/src/tester.c
Outdated
Show resolved
Hide resolved
tests/bsim/bluetooth/host/l2cap/einprogress/tester/src/tester.c
Outdated
Show resolved
Hide resolved
I'll delete the tester code, and rewrite the test. Basing it on a different test was a mistake. |
938ea3d
to
ae43589
Compare
ae43589
to
201b1c1
Compare
dae83b6
to
3ebe4e8
Compare
Fix discrepancy in reference management between calls to `bt_l2cap_chan_ops.recv` when the application returns `-EINPROGRESS`. There are two call sites, `l2cap_chan_le_recv_sdu` and `l2cap_chan_le_recv`, that were inconsistent. `l2cap_chan_le_recv_sdu` moves the reference, and this patch updates `l2cap_chan_le_recv` to do the same. This behavior is also now documented. This bug has existed since the introduction of this feature in 3151d26. Signed-off-by: Aleksander Wasaznik <[email protected]>
For ease of development, we should log the event as an error. Signed-off-by: Aleksander Wasaznik <[email protected]>
3ebe4e8
to
83cebe8
Compare
8229fd8
to
f4b8925
Compare
e0b7903
to
58da9bd
Compare
@@ -262,13 +263,23 @@ void bt_send_one_host_num_completed_packets(uint16_t handle) | |||
BT_ASSERT_MSG(err == 0, "Unable to send Host NCP (err %d)", err); | |||
} | |||
|
|||
#if defined(CONFIG_BT_TESTING) | |||
__weak void bt_testing_trace_event_acl_pool_destroy(struct net_buf *buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of public testing headers. If this is for internal testing, then I think such headers are better placed in a non-public place. Placing a testing.h
makes more sense if it's a testing API that is designed to be used for users (maybe that is the intention?).
We actually recently moved the Mesh testing.h
header file from the public include directory to internal.
This is needed for a test to catch a double-free. Signed-off-by: Aleksander Wasaznik <[email protected]>
This is shorthand for random static addresses. It's similar to `bt_addr_le_from_str`, but is a macro that results in an object literal, making it more versatile and less verbose. This macro only gives access to the first 255 random static addresses, but this ought to be enough addresses for testing. Signed-off-by: Aleksander Wasaznik <[email protected]>
The test implementation is based on a copy of the HFC multilink test. The test verifies that the stack respects the reference counting of SDU buffers when the L2CAP -EINPROGRESS feature is used. Signed-off-by: Aleksander Wasaznik <[email protected]>
58da9bd
to
e8b9c00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, I will not block this PR based on the testing API, but I do have my reservations about it.
Fix discrepancy in reference management between calls to
bt_l2cap_chan_ops.recv
when the application returns-EINPROGRESS
.There are two call sites,
l2cap_chan_le_recv_sdu
andl2cap_chan_le_recv
, that were inconsistent.l2cap_chan_le_recv_sdu
moves the reference, and this patch updatesl2cap_chan_le_recv_sdu
to do the same.This behavior is also now documented.
This bug has existed since the introduction of this feature in 3151d26.
Signed-off-by: Aleksander Wasaznik [email protected]