Diff between 57f15616abdef2a7a300018c9d32c723b2f9f743 and 96ab7296cb92705de8aabcdc14d81386b564d452

Changed Files

File Additions Deletions Status
src/shared/att.c +9 -0 modified

Full Patch

diff --git a/src/shared/att.c b/src/shared/att.c
index b90af93..85feead 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);