From 96ab7296cb92705de8aabcdc14d81386b564d452 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 7 Mar 2023 13:00:22 -0800 Subject: shared/att: Always queue BT_ATT_OP_MTU_REQ on the fixed channel BT_ATT_OP_MTU_REQ shall only be sent on the so called fixed channel since EATT channels shall use L2CAP procedure to update its MTU. --- src/shared/att.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/shared/att.c b/src/shared/att.c index b90af93cc..85feead77 100644 --- a/src/shared/att.c +++ b/src/shared/att.c @@ -1588,6 +1588,14 @@ unsigned int bt_att_send(struct bt_att *att, uint8_t opcode, op->id = att->next_send_id++; + /* Always use fixed channel for BT_ATT_OP_MTU_REQ */ + if (opcode == BT_ATT_OP_MTU_REQ) { + struct bt_att_chan *chan = queue_peek_tail(att->chans); + + result = queue_push_tail(chan->queue, op); + goto done; + } + /* Add the op to the correct queue based on its type */ switch (op->type) { case ATT_OP_TYPE_REQ: @@ -1606,6 +1614,7 @@ unsigned int bt_att_send(struct bt_att *att, uint8_t opcode, break; } +done: if (!result) { free(op->pdu); free(op); -- cgit v1.2.1