android/gatt: Fix initial setting of MTU

System Internals / BlueZ - Lukasz Rymanowski [tieto.com] - 3 February 2015 05:43 UTC

Initial setting of MTU should be IMTU. This is actually our assumption in other part of code, that IMTU is something we start with and change if needed after exchange MTU procedure.

If we are not able to get IMTU from the socket just disconnect, there is something wrong going on.

Without this patch you can face the issue with following scenario: 1. On connection complete MTU is set to 23 2. BfA sends Exchange MTU Request with MTU set to IMTU 3. Remote device response with MTU equal to what BfA sends 4. In that case, since remote MTU is equal to ours, there is no update in bt_att, so bt_att keep using MTU = 23 5. Remote sends packets highier then 23 and bt_att start to drop not complete packets.

Issue found and fix tested on UPF50

f417aeb android/gatt: Fix initial setting of MTU
android/gatt.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

Upstream: git.kernel.org


  • Share