Skip to contentSkip to conversation

gatt-server: Limit the Server MTU based on the Client MTU

PATCH In review Luiz Augusto von Dentz 2 participants 2 messages Mar 22, 2022 – Mar 23, 2022 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 gatt-server: Limit the Server MTU based on the Client MTU

From: Luiz Augusto von Dentz <[email protected]>

The spec is clear that the final ATT MTU is calculate using the minimum of Client RX MTU and Server RX MTU but some peripherals seem to expect the Server to already calculate the final MTU and not respond with its own MTU.

---
 src/shared/gatt-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/shared/gatt-server.c +1 -1
index 2adb4afbf..d326782bf 100644
@@ -1499,7 +1499,7 @@ static void exchange_mtu_cb(struct bt_att_chan *chan, uint8_t opcode,
 	final_mtu = MAX(MIN(client_rx_mtu, server->mtu), BT_ATT_DEFAULT_LE_MTU);
 
 	/* Respond with the server MTU */
-	put_le16(server->mtu, rsp_pdu);
+	put_le16(final_mtu, rsp_pdu);
 	bt_att_chan_send_rsp(chan, BT_ATT_OP_MTU_RSP, rsp_pdu, 2);
 
 	/* Set MTU to be the minimum */
Signature · 1 line
2.35.1
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=625601

---Test result---

Test Summary:

CheckPatch                    PASS      1.48 seconds
GitLint                       FAIL      0.99 seconds
Prep - Setup ELL              PASS      50.55 seconds
Build - Prep                  PASS      0.74 seconds
Build - Configure             PASS      10.12 seconds
Build - Make                  PASS      1461.63 seconds
Make Check                    FAIL      12.98 seconds
Make Check w/Valgrind         FAIL      511.72 seconds
Make Distcheck                FAIL      246.21 seconds
Build w/ext ELL - Configure   PASS      10.14 seconds
Build w/ext ELL - Make        PASS      1435.79 seconds
Incremental Build with patchesPASS      0.00 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint with rule in .gitlint
Output:
[BlueZ] gatt-server: Limit the Server MTU based on the Client MTU
10: B1 Line exceeds max length (117>80): "Link: https://lore.kernel.org/linux-bluetooth/CABBYNZL-fjTd8JdmRRM5Y26d41KwDxvvuaED+j2+yPT-RBpMtw@mail.gmail.com/T/#t"

##############################
Test: Make Check - FAIL
Desc: Run 'make check'
Output:
./test-driver: line 107: 30021 Aborted (core dumped) "$@" > $log_file 2>&1
make[3]: *** [Makefile:10773: test-suite.log] Error 1 make[2]: *** [Makefile:10881: check-TESTS] Error 2 make[1]: *** [Makefile:11275: check-am] Error 2
make: *** [Makefile:11277: check] Error 2

##############################
Test: Make Check w/Valgrind - FAIL
Desc: Run 'make check' with Valgrind
Output:
./test-driver: line 107: 47441 Aborted (core dumped) "$@" > $log_file 2>&1
make[3]: *** [Makefile:10773: test-suite.log] Error 1 make[2]: *** [Makefile:10881: check-TESTS] Error 2 make[1]: *** [Makefile:11275: check-am] Error 2
make: *** [Makefile:11277: check] Error 2

##############################
Test: Make Distcheck - FAIL
Desc: Run distcheck to check the distribution Output:
../../test-driver: line 107: 67803 Aborted (core dumped) "$@" > $log_file 2>&1
make[4]: *** [Makefile:10773: test-suite.log] Error 1 make[3]: *** [Makefile:10881: check-TESTS] Error 2 make[2]: *** [Makefile:11275: check-am] Error 2 make[1]: *** [Makefile:11277: check] Error 2
make: *** [Makefile:11198: distcheck] Error 1

---
Regards,
Linux Bluetooth