Skip to content

Commit 76c0725

Browse files
lylezhu2012kartben
authored andcommitted
Bluetooth: Classic: L2CAP: Fix the FCS incorrect issue
The FCS flag of TX direction is not set correctly if the FCS flag of RX direction is set. The issue could be found with following steps, Step 1, Local sends configuration request with ERET mode and FCS omitted. Step 2, Peer replies the configuration response without any errors. Step 3, Peer sends configuration request with ERET mode and NO FCS. Step 4, Local replies the configuration response without any errors. The FCS flag of TX is cleared incorrectly. The FCS should be enabled if any one side enables the FCS. Signed-off-by: Lyle Zhu <[email protected]>
1 parent b3581fe commit 76c0725

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subsys/bluetooth/host/classic/l2cap_br.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4356,9 +4356,10 @@ static void l2cap_br_conf_req(struct bt_l2cap_br *l2cap, uint8_t ident, uint16_t
43564356
}
43574357

43584358
#if defined(CONFIG_BT_L2CAP_RET_FC)
4359-
if (BR_CHAN(chan)->tx.fcs == BT_L2CAP_BR_FCS_16BIT) {
4360-
/* If peer enables FCS, local also needs to enable it. */
4359+
if (BR_CHAN(chan)->tx.fcs != BR_CHAN(chan)->rx.fcs) {
4360+
/* If FCS flag is not consistent of both sides, FCS should be used as default. */
43614361
BR_CHAN(chan)->rx.fcs = BT_L2CAP_BR_FCS_16BIT;
4362+
BR_CHAN(chan)->tx.fcs = BT_L2CAP_BR_FCS_16BIT;
43624363
}
43634364

43644365
if (BR_CHAN(chan)->tx.extended_control) {

0 commit comments

Comments
 (0)