Skip to content
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: Controller: llcp: Fix assert if LL_REJECT_IND PDU received while local and remote control procedure is pending #45853

Conversation

ppryga-nordic
Copy link
Collaborator

In case there are pending two control procedures: local and remote,
and remote device sends LL_REJECT_IND PDU then assertion happened.
ull_cp_rx function triggers assertion because LL_REJECT_IND is
considered as expected packet for all local and remote control
proceures.

That is not correct. It does not allow local procedure to handle
a response and stops a device on assert.

A remote device should not send LL_REJECT_IND PDU for locally initiated
control procedures, hence local device should not expect to receive
LL_REJECT_IND PDU to be expected one for pending remote control
procedure.

Remote device is allowed to send LL_REJECT_EXT_IND PDU for a locally
initiated control procedures. The LL_REJECT_EXT_IND PDU has a Reject-
Opcode that identifies rejected control procedure, hence is may be
expected by local device.

The commit provides changes that prevent the Controller assertion
in described case.

Signed-off-by: Piotr Pryga [email protected]

@ppryga-nordic ppryga-nordic force-pushed the github-ble-llcp-fix-assert-when-ll-reject-received branch from e365c26 to f49d72e Compare May 21, 2022 11:09
@ppryga-nordic ppryga-nordic added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth LLCP labels May 21, 2022
@ppryga-nordic ppryga-nordic added this to the v3.1.0 milestone May 21, 2022
@ppryga-nordic ppryga-nordic force-pushed the github-ble-llcp-fix-assert-when-ll-reject-received branch 2 times, most recently from 8f1e460 to 2638711 Compare May 23, 2022 05:36
cvinayak
cvinayak previously approved these changes May 23, 2022
In case there are pending two control procedures: local and remote,
and remote device sends LL_REJECT_IND PDU then assertion happened.
ull_cp_rx function triggers assertion because LL_REJECT_IND is
considered as expected packet for all local and remote control
procedures.

That is not correct. It does not allow local procedure to handle
a response and stops a device on assert.

A remote device should not send LL_REJECT_IND PDU for locally initiated
control procedures, hence local device should not expect to receive
LL_REJECT_IND PDU to be expected one for pending remote control
procedure.

Remote device is allowed to send LL_REJECT_EXT_IND PDU for a locally
initiated control procedures. The LL_REJECT_EXT_IND PDU has a Reject-
Opcode that identifies rejected control procedure, hence is may be
expected by local device.

The commit provides changes that prevent the Controller assertion
in described case.

Signed-off-by: Piotr Pryga <[email protected]>
@ppryga-nordic ppryga-nordic force-pushed the github-ble-llcp-fix-assert-when-ll-reject-received branch from 2638711 to 13cf08a Compare May 23, 2022 08:33
@ppryga-nordic
Copy link
Collaborator Author

Fixed an error that make the UT to fail.

Copy link
Collaborator

@erbr-ot erbr-ot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carlescufi carlescufi merged commit 1d89b27 into zephyrproject-rtos:main May 25, 2022
@ppryga-nordic ppryga-nordic deleted the github-ble-llcp-fix-assert-when-ll-reject-received branch September 5, 2022 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants