src/device.c : Fix BREDR-ATT MTU issue 89/179389/2
authorNagaraj D R <nagaraj.dr@samsung.com>
Thu, 17 May 2018 10:50:05 +0000 (16:20 +0530)
committerNagaraj D R <nagaraj.dr@samsung.com>
Thu, 17 May 2018 13:51:37 +0000 (13:51 +0000)
For BREDR-ATT, according to spec, ATT MTU is same has
L2CAP configured MTU on which ATT is running and there won't be
ATT MTU exchange procedure. So, set the MTU to L2CAP MTU for
BREDR-ATT and for LE-ATT adjust the ATT MTU based on
EXCHANGE_MTU request and response.

Change-Id: Icd402edbfa7ddb82e808ebf695096b7a872ebc14

src/device.c

index bd1b87e..08a0234 100644 (file)
@@ -7142,7 +7142,9 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io)
 #endif
 
        dev->att_mtu = MIN(mtu, BT_ATT_MAX_LE_MTU);
-       attrib = g_attrib_new(io, BT_ATT_DEFAULT_LE_MTU, false);
+       attrib = g_attrib_new(io,
+                       cid == ATT_CID ? BT_ATT_DEFAULT_LE_MTU : dev->att_mtu,
+                       false);
        if (!attrib) {
                error("Unable to create new GAttrib instance");
                return false;