Thread (5 messages) flat view 5 messages, 2 authors, 2021-08-25
STALE1857d

[PATCH BlueZ 2/3] shared/att: Fix attempting to send Exchange MTU on EATT bearer

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2021-08-25 21:14:24
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luiz Augusto von Dentz <redacted>

EATT bearer shall use the L2CAP signalling for negotiating the MTU
size.
---
 src/shared/att.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/shared/att.c b/src/shared/att.c
index 665d7f4b8..329497728 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -411,10 +411,17 @@ static struct att_send_op *pick_next_send_op(struct bt_att_chan *chan)
 	 */
 	if (!chan->pending_req) {
 		op = queue_peek_head(att->req_queue);
-		if (op && op->len <= chan->mtu)
+		if (op && op->len <= chan->mtu) {
+			/* Don't send Exchange MTU over EATT */
+			if (op->opcode == BT_ATT_OP_MTU_REQ &&
+					chan->type == BT_ATT_EATT)
+				goto indicate;
+
 			return queue_pop_head(att->req_queue);
+		}
 	}
 
+indicate:
 	/* There is either a request pending or no requests queued. If there is
 	 * no pending indication, pick an operation from the indication queue.
 	 */
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help