Skip to content

Commit 3756429

Browse files
lylezhu2012nashif
authored andcommitted
Bluetooth: BREDR: L2CAP: Recover ident when conn is pending
The `ident` of L2CAP BR connection req will be cleared if function l2cap_br_conn_req_reply called to send L2CAP BR connection rsp with result `BT_L2CAP_BR_PENDING`. Then the invalid `ident` (it is zero) will be filled in the L2CAP BR connection rsp after the ACL connection is encrypted. Recover `ident` if the result of the connection rsp is `BT_L2CAP_BR_PENDING`. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
1 parent c7c1f73 commit 3756429

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/bluetooth/host/classic/l2cap_br.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,9 @@ static void l2cap_br_conn_req(struct bt_l2cap_br *l2cap, uint8_t ident,
10751075
/* Disconnect link when security rules were violated */
10761076
if (result == BT_L2CAP_BR_ERR_SEC_BLOCK) {
10771077
bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL);
1078+
} else if (result == BT_L2CAP_BR_PENDING) {
1079+
/* Recover the ident when conn is pending */
1080+
br_chan->ident = ident;
10781081
}
10791082

10801083
return;

0 commit comments

Comments
 (0)