[PATCH BlueZ 10/10] attrib-server: Fix MTU for GATT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch changes the size of the input and output buffers to the same size of
the channel MTU. The channel MTU, in turn, is the L2CAP MTU for BR/EDR
channels, and the ATT MTU for LE channels. This value can change between calls
to channel_handler if a GATT MTU exchange procedure is performed, which is only
supported by LE channels.
---
 src/attrib-server.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 5adbf92..9064d15 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -910,7 +910,7 @@ static void channel_handler(const uint8_t *ipdu, uint16_t len,
 							gpointer user_data)
 {
 	struct gatt_channel *channel = user_data;
-	uint8_t opdu[ATT_MAX_MTU], value[ATT_MAX_MTU];
+	uint8_t opdu[channel->mtu], value[ATT_MAX_MTU];
 	uint16_t length, start, end, mtu, offset;
 	bt_uuid_t uuid;
 	uint8_t status = 0;
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux