shared/att: Fix mtu not updated issue 89/302589/1 accepted/tizen/7.0/unified/20231212.053547
authorWootak Jung <wootak.jung@samsung.com>
Mon, 11 Dec 2023 01:27:49 +0000 (10:27 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 11 Dec 2023 01:32:08 +0000 (10:32 +0900)
Reproduction steps:
1. gatt connected
2. request to the remote with mtu 517
3. when getting mtu, 517 returned
4. mtu 512 changed received from the remote
5. when getting mtu, 517 returned. (Should be 512)

Change-Id: Ic2c6b19690d7da7572762083ab9577cb3b9e0e97
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/shared/att.c

index 229897d..0d1ca31 100755 (executable)
@@ -1437,7 +1437,11 @@ bool bt_att_set_mtu(struct bt_att *att, uint16_t mtu)
 
        chan->mtu = mtu;
        chan->buf = buf;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       if (chan->mtu != att->mtu) {
+#else
        if (chan->mtu > att->mtu) {
+#endif
                att->mtu = chan->mtu;
                queue_foreach(att->exchange_list, exchange_handler,
                                                INT_TO_PTR(att->mtu));