Skip to content

Commit 3561540

Browse files
lylezhu2012nashif
authored andcommitted
Bluetooth: L2CAP_BR: Set flags in CFG RSP
The flags of L2CAP_CONFIGURATION_REQ are set. But in L2CAP_CONFIGURATION_RSP, all bits of flags are cleared. When used in the L2CAP_CONFIGURATION_RSP packet, the continuation flag shall be set to one if the flag is set to one in the Request. Copy flags from Request to Response if it is a successful result. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
1 parent b7ab7c9 commit 3561540

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

subsys/bluetooth/host/classic/l2cap_br.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,16 @@ static void l2cap_br_conf_req(struct bt_l2cap_br *l2cap, uint8_t ident,
14661466
rsp->result = sys_cpu_to_le16(result);
14671467
rsp->scid = sys_cpu_to_le16(BR_CHAN(chan)->tx.cid);
14681468

1469+
/*
1470+
* Core 5.4, Vol 3, Part A, section 4.5.
1471+
* When used in the L2CAP_CONFIGURATION_RSP packet,
1472+
* the continuation flag shall be set to one if the
1473+
* flag is set to one in the Request, except for
1474+
* those error conditions more appropriate for an
1475+
* L2CAP_COMMAND_REJECT_RSP packet.
1476+
*/
1477+
rsp->flags = sys_cpu_to_le16(flags & BT_L2CAP_CONF_FLAGS_MASK);
1478+
14691479
/*
14701480
* TODO: If options other than MTU became meaningful then processing
14711481
* the options chain need to be modified and taken into account when

subsys/bluetooth/host/classic/l2cap_br_internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ struct bt_l2cap_conn_rsp {
7676
#define BT_L2CAP_CONF_PENDING 0x0004
7777
#define BT_L2CAP_CONF_FLOW_SPEC_REJECT 0x0005
7878

79+
#define BT_L2CAP_CONF_FLAGS_C BIT(0)
80+
#define BT_L2CAP_CONF_FLAGS_MASK BT_L2CAP_CONF_FLAGS_C
81+
7982
#define BT_L2CAP_CONF_REQ 0x04
8083
struct bt_l2cap_conf_req {
8184
uint16_t dcid;

0 commit comments

Comments
 (0)