From de49880ea231e0451363a15f250ad0a2c940fe87 Mon Sep 17 00:00:00 2001 From: Nagaraj D R Date: Thu, 17 May 2018 16:20:05 +0530 Subject: [PATCH] src/device.c : Fix BREDR-ATT MTU issue 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index bd1b87e..08a0234 100644 --- a/src/device.c +++ b/src/device.c @@ -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; -- 2.7.4